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

Exit with exit code 1 if a rule violation was found #35

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

faern
Copy link
Member

@faern faern commented Nov 29, 2024

This PR builds on top of #31 and must be merged after that PR.

Since the main use case for this tool is to run in CI and other automated pipelines, it must have some easy to use way of notifying upstream that it found an error! Without this, it becomes much harder to detect if the tool failed or not.

This check is not perfect. We might want to exit with a non-zero exit code in more cases. Such as on parsing errors etc. But I leave that as a future exercise, this is way better than before at least. I leave the rest for later also partially because I think we need to improve the error handling situation overall. Currently there is no way for the main function to know if a specific scan failed in a specific way.

@faern faern force-pushed the non-zero-exit-code-on-error branch from 6277263 to 549f6bd Compare November 29, 2024 12:24
Base automatically changed from report-scan-stats to main November 29, 2024 12:29
@faern faern force-pushed the non-zero-exit-code-on-error branch from 549f6bd to 2fb2764 Compare November 29, 2024 12:29
@faern faern merged commit dbb86a9 into main Nov 29, 2024
12 checks passed
@faern faern deleted the non-zero-exit-code-on-error branch November 29, 2024 12:32
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.

2 participants