yu-iskw / action-sqlfluff

Run sqlfluff with reviewdog to check or format styles
https://github.com/marketplace/actions/run-sqlfluff-with-reviewdog
MIT License
68 stars 27 forks source link

support sqlfluff v1.4.5 #52

Closed vgw-chriskruger closed 1 year ago

vgw-chriskruger commented 1 year ago

The current release version of sqlfluff is 1.4.5. This PR allows for its use in the action.

yu-iskw commented 1 year ago

@vgw-chriskruger Thank you for the pull request. Can you modify any testing SQL file of a dbt model. For instance, just deleting an empty line would be ok. By doing so, the GitHub Actions to validate SQL files will work.

vgw-chriskruger commented 1 year ago

So it looks like the checks have run now.

yu-iskw commented 1 year ago

The GitHub Action skips to execute SQLFluss, if there is no changed files. That's because SQLFluss takes a long time, if there are a lot of scanned files. So, the Action checks only changed files.

https://github.com/yu-iskw/action-sqlfluff/blob/main/entrypoint.sh#L24-L29

We take advantage of the testing dbt project in testdata/test_failed_dbt. We have to change any of SQL files to completely check changes in pull requests are ok.

https://github.com/yu-iskw/action-sqlfluff/tree/main/testdata/test_failed_dbt

As we don't have any changes of testing SQL files in the pull request, entrypoint.sh existed due to no changed files. image

vgw-chriskruger commented 1 year ago

Sorry I was a numpty. I didn't commit the change as I had thought 😊 apologies for the confusion.

yu-iskw commented 1 year ago

@vgw-chriskruger No problem. Now, we can see the comments by reviewdog. Let's merge this. Thank you for the contribution!

https://github.com/yu-iskw/action-sqlfluff/pull/52/commits/00008fe303baaf320d4fa5fe678ca35cdd9d3437 image