-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
H-3304: Initial setup for SqlFluff
#5781
Merged
TimDiekmann
merged 8 commits into
main
from
t/h-3304-use-sqlfluff-as-sql-formatterlinter
Dec 3, 2024
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f755b80
Initial setup for SqlFluff
TimDiekmann 942d0dc
Use proper annotations
TimDiekmann dda3ea4
Compile in an SQL fmt error
TimDiekmann 03329d0
Update .sqlfluff
TimDiekmann 50c4181
Set annotation level
TimDiekmann 9c9fdfb
Merge remote-tracking branch 'origin/t/h-3304-use-sqlfluff-as-sql-forβ¦
TimDiekmann db39eba
Set annotation level to failure
TimDiekmann a112102
Fix linting
TimDiekmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[sqlfluff] | ||
dialect = postgres | ||
encoding = utf-8 | ||
|
||
max_line_length = 100 | ||
large_file_skip_byte_limit = 100000 | ||
|
||
|
||
[sqlfluff:indentation] | ||
indented_ctes = True | ||
indented_on_contents = False | ||
allow_implicit_indents = True | ||
|
||
[sqlfluff:rules] | ||
single_table_references = qualified | ||
|
||
[sqlfluff:rules:capitalisation.keywords] | ||
capitalisation_policy = upper | ||
|
||
[sqlfluff:rules:capitalisation.identifiers] | ||
extended_capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:capitalisation.functions] | ||
extended_capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:capitalisation.literals] | ||
capitalisation_policy = upper | ||
|
||
[sqlfluff:rules:capitalisation.types] | ||
extended_capitalisation_policy = upper | ||
|
||
|
||
[sqlfluff:rules:convention.count_rows] | ||
prefer_count_1 = True | ||
|
||
[sqlfluff:rules:ambiguous.column_references] | ||
# GROUP BY/ORDER BY column references | ||
group_by_and_order_by_style = explicit | ||
|
||
|
||
[sqlfluff:rules:convention.not_equal] | ||
# Consistent usage of preferred "not equal to" comparison | ||
preferred_not_equal_style = c_style | ||
|
||
|
||
[sqlfluff:rules:convention.casting_style] | ||
# SQL type casting | ||
preferred_type_casting_style = shorthand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
CREATE EXTENSION | ||
citus; | ||
citus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
libs/@local/graph/postgres-store/postgres_migrations/.sqlfluffignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I am not sure if I am a huge fan of the removal of indentation here (or citus one), but no strong opinions really.
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.
Probably this is configurable. I'll take a Quick Look
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.
Found for
JOIN
but not for creating indices/extensions. Also not a strong opinion, so I'll just merge it π