Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix wrong lint exit code #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix wrong lint exit code #40

wants to merge 1 commit into from

Conversation

XiChu2333
Copy link

fix issue #39

main...XiChu2333:action-sqlfluff:main#:~:text=%24lint_results%22-,sqlfluff_exit_code%3D%24%3F,-sqlfluff_exit_code%3D%24%3F

Variable sqlfluff_exit_code would receive the return code of command "tee "$lint_results"" instead of the return code sqlfluff.
So, the return code is always 0.
Fix it by using ">>" to replace "tee"

@XiChu2333 XiChu2333 requested a review from yu-iskw as a code owner July 21, 2022 21:52
@kieronellis
Copy link
Contributor

@yu-iskw

@ktopcuoglu
Copy link

@XiChu2333, thanks for this patch. Did you consider using sqlFluff's --write-output, instead of >> ?

In my project, we have a few configurations which don't apply to any resources; thus, when templater configured with dbt SqlFluff returns Dbt's warning logs, and those lines cause failure with jq (to built rdjson)

18:16:56  [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 21 unused configuration paths:
- models.my_project.staging.mysql_user
- models.my_project.staging.braze_user
...
[...actual format=json lint result here..]

--write-output worked better in my case.

@chu-xi
Copy link

chu-xi commented May 23, 2023

@XiChu2333, thanks for this patch. Did you consider using sqlFluff's --write-output, instead of >> ?

In my project, we have a few configurations which don't apply to any resources; thus, when templater configured with dbt SqlFluff returns Dbt's warning logs, and those lines cause failure with jq (to built rdjson)

18:16:56  [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 21 unused configuration paths:
- models.my_project.staging.mysql_user
- models.my_project.staging.braze_user
...
[...actual format=json lint result here..]

--write-output worked better in my case.

That sounds good. But seems the author has correct the file himself. I don't know why this PR is still here

@enclaver
Copy link

I'm still seeing this issue where there are linting problems, but workflow is green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants