-
Notifications
You must be signed in to change notification settings - Fork 12
757 sql reformatting finetune sqlfluff #765
757 sql reformatting finetune sqlfluff #765
Conversation
| honors SMALLINT NOT NULL, | ||
| visits SMALLINT NOT NULL, | ||
| harvested SMALLINT NOT NULL, | ||
| privacy PRIVACY_OPTION NOT NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not according to current database guidelines, we wrote: "use snake_case for everything except database keywords, which should be UPPERCASE". So it should be privacy_option. Isn't this supported by sqlfluff?
Btw. even for INTEGER it is questionable if it is a keyword, according to https://www.postgresql.org/docs/current/sql-keywords-appendix.html INTEGER is non-reserved (cannot be function or type).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not according to current database guidelines, we wrote: "use
snake_casefor everything except database keywords, which should beUPPERCASE". So it should beprivacy_option. Isn't this supported by sqlfluff?
No, sadly it's not, but I applied it for now by manually changing the rules.
https://docs.sqlfluff.com/en/stable/rules.html#rule-capitalisation.types
Btw. even for INTEGER it is questionable if it is a keyword, according to https://www.postgresql.org/docs/current/sql-keywords-appendix.html INTEGER is non-reserved (cannot be function or type).
I could make it snake_case, but since it's a standard keyword, I would keep it uppercase.
We can solve it by creating a new entry into |
|
|
Great job, let us see what they say, maybe we can go the direct way without workarounds in our pre-commit/CI configs. |
Yes as temmy said, we could write a second sqlfluff hook with a different id and make sure they dont run over the same files. |
4ydan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-commit looks good now, but isnt it possible to just have two different hooks in there instead of manuall shifting something around in the config file?
|
If we want to do it like that, I will write a commit for it. Manual shifting is a bad solution. |
badnames
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! I just noticed a few minor styling and grammar mistakes.
doc/decisions/example_migrations/taxonomy-ranks-and-concrete-plants/example_queries.sql.md
Show resolved
Hide resolved
doc/decisions/example_migrations/taxonomy-ranks-and-concrete-plants/example_queries.sql.md
Show resolved
Hide resolved
doc/decisions/example_migrations/taxonomy-ranks-and-concrete-plants/example_queries.sql.md
Show resolved
Hide resolved
doc/decisions/example_migrations/taxonomy-ranks-and-concrete-plants/example_queries.sql.md
Show resolved
Hide resolved
doc/decisions/example_migrations/taxonomy-ranks-and-concrete-plants/example_queries.sql.md
Show resolved
Hide resolved
doc/decisions/example_migrations/normalized-plants-and-ranks/example_queries.sql.md
Show resolved
Hide resolved
doc/decisions/example_migrations/normalized-plants-and-ranks/example_queries.sql.md
Show resolved
Hide resolved
490fb70 to
ee4696f
Compare
|
Isnt this now doing exactly what we want in one config file? |
a83ef0f to
2d32ca5
Compare
2d32ca5 to
e2feeea
Compare
|
Great job, finally done! I am happy with these a bit relaxed rules. The tool also shouldn't get in the way too much. |
closes #757
Basics
close #X, are in the commit messages.Checklist
(not in the PR description)
(exceptions are documented)
Review