sbdchd / squawk

🐘 linter for PostgreSQL, focused on migrations
https://squawkhq.com
GNU General Public License v3.0
541 stars 37 forks source link

Exit code 1 for warnings (warning vs error handling) #348

Open ashtonian opened 1 month ago

ashtonian commented 1 month ago

It would be nice if the handling around warnings and errors was more configurable ie --errors-only or --warnings-as-errors=true/false. Right now it returns an exit code 1 when there is just warnings which is treating warnings as errors. A flag would be nice.

chdsbd commented 1 month ago

I think we report all violations as warnings:

https://github.com/sbdchd/squawk/blob/6437c3ca743d07f3c7ce8ebe49240b2c5aa65c1c/cli/src/reporter.rs#L393-L402

Maybe we could mimic eslint's exit codes.