quarylabs / sqruff

Fast SQL formatter/linter
https://playground.quary.dev/?secondary=Format
Apache License 2.0
364 stars 14 forks source link

Optionaly give a return code of 1 for sqruff fix if anything is flagged #893

Open concur1 opened 3 weeks ago

concur1 commented 3 weeks ago

I appreciate you all are working hard on this. Thanks!

sqlfluff gives a return code of 1 when running fix and finding unfixable linting violations and a return code 0 when there are no unfixable linting violations. It would be great if sqruff could replicate this behavior.

this functionality would be really helpful to me as it would allow me to just use sqruff fix in a pre commit hook instaead of both sqruff fix and sqruff lint. This halves the run time which is useful for large files.

benfdking commented 3 weeks ago

That's a good shout! I do think it should return 1 if it can't fix everything and tell you.