The recommended flow for CI integration is to determine the modified files, and run the analysis in reactive mode starting from those files. If you would like to run more than one analyzer, it is more efficient to separate the capture phase, so that the result can be used by all the analyzers.
Here's how to run infer on two versions of a project and compare the results in general.
Assume the project uses git,
feature is the feature branch (the code change
you want to analyze),
main is the main branch, and
make builds the
At the end of this process, "infer-out/differential/" contains three files, which follow the same format as normal infer JSON reports:
- introduced.json contains the issues found in the feature branch but not in main;
- fixed.json contains the issues found in main but not in the feature branch;
- preexisting.json contains the issues found in both branches.
The following CI script runs the
eradicate analyzers. Assume again
feature is the feature branch, and
main is the main branch.
- We use git to find the changed files
git diff --name-only
- We run capture only once, and the output is kept for the subsequent analyses
- We run the eradicate analysis alongside the default analyses:
- We analyze only the changed files