-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from Synthetixio/transformers/add-sqlfluff
Transformers - Add sqlfluff workflow
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Lint Transformer Models | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'transformers/**' | ||
|
||
jobs: | ||
lint-models: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
- uses: "actions/setup-python@v3" | ||
with: | ||
python-version: "3.10.11" | ||
- name: Install SQLFluff | ||
run: "pip install sqlfluff" | ||
- name: Lint models | ||
run: "diff-quality --violations=sqlfluff --compare-branch origin/main --fail-under 100" |
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,37 @@ | ||
[sqlfluff] | ||
dialect = postgres | ||
templater = jinja | ||
runaway_limit = 10 | ||
max_line_length = 80 | ||
indent_unit = space | ||
|
||
[sqlfluff:indentation] | ||
tab_space_size = 4 | ||
|
||
[sqlfluff:layout:type:comma] | ||
spacing_before = touch | ||
line_position = trailing | ||
|
||
[sqlfluff:rules:capitalisation.keywords] | ||
capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:aliasing.table] | ||
aliasing = explicit | ||
|
||
[sqlfluff:rules:aliasing.column] | ||
aliasing = explicit | ||
|
||
[sqlfluff:rules:aliasing.expression] | ||
allow_scalar = False | ||
|
||
[sqlfluff:rules:capitalisation.identifiers] | ||
extended_capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:capitalisation.functions] | ||
capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:capitalisation.literals] | ||
capitalisation_policy = lower | ||
|
||
[sqlfluff:rules:ambiguous.column_references] # Number in group by | ||
group_by_and_order_by_style = implicit |
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,4 @@ | ||
target/ | ||
dbt_modules/ | ||
macros/ | ||
templates/ |