File tree Expand file tree Collapse file tree 2 files changed +28
-33
lines changed Expand file tree Collapse file tree 2 files changed +28
-33
lines changed Original file line number Diff line number Diff line change 11name : SQLFluff
22
33on :
4- - pull_request
4+ - push
55
66jobs :
77 lint-mimic-iv :
88 runs-on : ubuntu-latest
99 steps :
1010 - name : checkout
11- uses : actions/checkout@v3
11+ uses : actions/checkout@v4
1212 - name : Install Python
13- uses : " actions/setup-python@v2 "
13+ uses : actions/setup-python@v5
1414 with :
15- python-version : " 3.7 "
15+ python-version : " 3.12 "
1616 - name : install sqlfluff
17- run : " pip install sqlfluff==1.4.5 "
17+ run : " pip install sqlfluff==3.5.0 "
1818 - name : Get changed files
1919 id : get_file_changes
20202121 with :
2222 output : ' '
2323 - name : Get changed .sql files in mimic-iv concepts folder
2424 id : get_files_to_lint
25- shell : bash -l {0}
25+ shell : bash
2626 run : |
27- # Set the command in the $() brackets as an output to use in later steps
28- echo "lintees=$(
29- echo \
30- $(echo ${{ steps.get_file_changes.outputs.files_modified }} |
31- tr -s ' ' '\n' |
32- grep -E '^mimic-iv/concepts/.*[.]sql$' |
33- tr -s '\n' ' ') \
34- $(echo ${{ steps.get_file_changes.outputs.files_added }} |
35- tr -s ' ' '\n' |
36- grep -E '^mimic-iv/concepts/.*[.]sql$' |
37- tr -s '\n' ' ')
38- ) >> $GITHUB_OUTPUT"
27+ # Compose list of changed SQL files under mimic-iv/concepts and export to step output
28+ files="$(echo "${{ steps.get_file_changes.outputs.files_modified }} ${{ steps.get_file_changes.outputs.files_added }}" \
29+ | tr -s ' ' '\n' \
30+ | grep -E '^mimic-iv/concepts/.*[.]sql$' \
31+ | tr -s '\n' ' ')"
32+ echo "lintees=${files}" >> "$GITHUB_OUTPUT"
3933
4034 - name : Lint SQL files
4135 id : sqlfluff_json
4236 if : steps.get_files_to_lint.outputs.lintees != ''
43- shell : bash -l {0}
37+ shell : bash
4438 run : sqlfluff lint --format github-annotation --annotation-level failure --nofail ${{ steps.get_files_to_lint.outputs.lintees }} > annotations.json
4539 - name : Annotate
46- uses : yuzutech/annotations-action@v0.3 .0
40+ uses : yuzutech/annotations-action@v0.5 .0
4741 with :
4842 repo-token : " ${{ secrets.GITHUB_TOKEN }}"
4943 title : " SQLFluff Lint"
Original file line number Diff line number Diff line change 1- [sqlfluff:core]
2- rules = core,L019
3- large_file_skip_byte_limit = 40000
1+ [sqlfluff]
42dialect = bigquery
3+ large_file_skip_byte_limit = 40000
4+ exclude_rules = LT02
5+
6+ # Enable core rules plus explicit layout.commas (leading commas)
7+ [sqlfluff:core]
8+ rules = core,layout.commas
59
610[sqlfluff:layout:type:comma]
711line_position = leading
812
9- [sqlfluff:indentation]
10- indented_joins = false
11- indented_using_on = true
12- template_blocks_indent = false
13-
14- [sqlfluff:rules:L010]
15- # Keywords should be upper case
13+ # Capitalisation rules
14+ [sqlfluff:rules:capitalisation.keywords]
1615capitalisation_policy = upper
1716
18- [sqlfluff:rules:L030]
19- # Functions should be upper case
20- extended_capitalisation_policy = upper
17+ [sqlfluff:rules:capitalisation.functions]
18+ extended_capitalisation_policy = upper
19+
20+ [sqlfluff:rules:capitalisation.identifiers]
21+ extended_capitalisation_policy = lower
You can’t perform that action at this time.
0 commit comments