ignore suppressed issues for process exit code #1939
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In my usage,
infer runfails with a non-zero exit code even after I have suppressed all issues in my C project with@infer-ignorecomments (along with appropriate.inferconfigsettings).I tracked this down to how
fail_on_issue_epilogue()maps presence/absence of issues to the overall process exit code. The fix in this PR is to make Infer only return a non-zero exit code if one or more unsuppressed issues exist. In other words, Infer should treat a suppressed issue as equivalent to an entirely non-existent issue, for the purposes of the overallinfer runexit code.Please let me know if there are backwards-compatibility concerns that would require this behavior to be gated by an opt-in CLI argument. I am hoping it is acceptable to change the default behavior in this manner, in order to follow the principle of least surprise for people (like myself) using Infer in their CI pipelines.
I've added a test for this behavior, based on the existing
fail_on_issuetestcase. I hope the latter is an acceptable template for a new test; please let me know if a different testcase would make for a better starting point.