File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ name : SQLFluff
2+
3+ on :
4+ - pull_request
5+
6+ jobs :
7+ lint-mimic-iv :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : checkout
11+ uses : actions/checkout@v3
12+ - name : Install Python
13+ uses : " actions/setup-python@v2"
14+ with :
15+ python-version : " 3.7"
16+ - name : install sqlfluff
17+ run : " pip install sqlfluff==1.4.5"
18+ - name : Get changed files
19+ id : get_file_changes
20+ 21+ with :
22+ output : ' '
23+
24+ - name : Get changed .sql files in mimic-iv concepts folder
25+ id : get_files_to_lint
26+ shell : bash -l {0}
27+ run : |
28+ # Set the command in the $() brackets as an output to use in later steps
29+ echo "::set-output name=lintees::$(
30+ echo \
31+ $(echo ${{ steps.get_file_changes.outputs.files_modified }} |
32+ tr -s ' ' '\n' |
33+ grep -E '^mimic-iv/concepts/.*[.]sql$' |
34+ tr -s '\n' ' ') \
35+ $(echo ${{ steps.get_file_changes.outputs.files_added }} |
36+ tr -s ' ' '\n' |
37+ grep -E '^mimic-iv/concepts/.*[.]sql$' |
38+ tr -s '\n' ' ')
39+ )"
40+
41+ - name : Lint SQL files
42+ id : sqlfluff_json
43+ if : steps.get_files_to_lint.outputs.lintees != ''
44+ shell : bash -l {0}
45+ run : sqlfluff lint --format github-annotation --annotation-level failure --nofail ${{ steps.get_files_to_lint.outputs.lintees }} > annotations.json
46+ - name : Annotate
47+ 48+ with :
49+ repo-token : " ${{ secrets.GITHUB_TOKEN }}"
50+ title : " SQLFluff Lint"
51+ input : " ./annotations.json"
Original file line number Diff line number Diff line change 11[sqlfluff:core]
22rules = core,L019
33large_file_skip_byte_limit = 40000
4+ dialect = bigquery
45
56[sqlfluff:layout:type:comma]
67line_position = leading
You can’t perform that action at this time.
0 commit comments