commandbox-modules / commandbox-codechecker

A CLI wrapper for the Codechecker project
4 stars 6 forks source link

Improve exit codes #5

Closed bockensm closed 2 years ago

bockensm commented 4 years ago

Regardless of whether or not codechecker run succeeds or "fails" (not to run, but to pass all rules), the exit code returned is 0. I would like an exit code of 1 when any test fails so I can use this in CI or as a pre-push hook to stop code from going to a repository.

bdw429s commented 4 years ago

We can change this, but it has been left this way on purpose. Most of the code checkers rules are more suggestions and any code base of reasonable size would have thousands of matching rules so it seemed unlikely that anyone would ever get a "passing" run. I personally just use this to get a manual overview of issues in a code base and then parse through them in the Excel export to see what needs fixing. The signal to noise ratio was always too low for me to put it in a CI process.

How about we add a boolean flag to the command like --failOnMatch to control when the command returns a failing exit code.