I've found a few yml files on line which work, but my sqlfluff linter passes and it shouldn't.
This is my first time ever using github workflows and yml, so any advice would be great. I'm sure i'm missing somthing as to why workflow isn't using my defined linter instructions in the .sqlfluff file.
Here is my yml file:
name: sqlfluff with reviewdog
on:
pull_request:
jobs:
test-check:
name: runner / sqlfluff (github-check)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# only run when a comment requests linting
- uses: khan/pull-request-comment-trigger@master
id: check
with:
trigger: '/lint'
reaction: rocket
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- uses: yu-iskw/action-sqlfluff@v3
if: steps.check.outputs.triggered == 'true'
id: lint-sql
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
sqlfluff_version: "0.11.1"
sqlfluff_command: "fix" # Or "lint"
config: "${{ github.workspace }}/.sqlfluff"
paths: '${{ github.workspace }}/models'
- name: 'Show outputs (Optional)'
shell: bash
run: |
echo '${{ steps.lint-sql.outputs.sqlfluff-results }}' | jq -r '.'
echo '${{ steps.lint-sql.outputs.sqlfluff-results-rdjson }}' | jq -r '.'
Here is the .sqlfluff file:
[sqlfluff]
# This change (from jinja to dbt templater) will make linting slower
# because linting will first compile dbt code into data warehouse code.
templater = dbt
runaway_limit = 10
max_line_length = 120
indent_unit = space
tab_space_size = 4
indented_joins = False
indented_ctes = False
indented_using_on = True
indented_on_contents = True
indented_then = False
indented_then_contents = True
allow_implicit_indents = True
template_blocks_indent = False
# This is a comma seperated list of elements to skip
# indentation edits to.
skip_indentation_in = script_content
# If comments are found at the end of long lines, we default to moving
# them to the line _before_ their current location as the convention is
# that a comment precedes the line it describes. However if you prefer
# comments moved _after_, this configuration setting can be set to "after".
trailing_comments = before
[sqlfluff:indentation]
tab_space_size = 4
[sqlfluff:layout:type:comma]
spacing_before = touch
line_position = leading
Any guidance would be appreciated!