-
Notifications
You must be signed in to change notification settings - Fork 380
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
[analyzer] Cppcheck support #3680
Conversation
Closes #484 |
a1203fa
to
91c14aa
Compare
This commit adds support for the Cppcheck analyzer. The following two commits are also squashed into this: * [test] Add new test cases for Cppcheck support * [analyzer] Check version compatibility This commit is the resurrection of works made by Márton Csordás. The original pull request Ericsson#2290 had three more refactoring related change sets which were omitted in this. Some changes were added in compared to the original commits: * The Cppcheck report converter is used to get the results in the result_handler. * The hash calculation logic has been uplifted to the latest one. * Some small small compatibility changes were added because of the changes in the code base. Co-authored-by: bruntib <bruntib@users.noreply.github.com> Co-authored-by: vodorok <vodorok@gmail.com>
This patch is a work in progress, there are debug prints all over the place inside Codechecker, treat it accordingly. Will be amended, and split up, when I am back from vacation. Cppcheck now works in a raw directory instead of directly into the workspace folder. Exponential explosion of reports in plist files are now fixed. Checker disable now works on native levels. The `--disable <cppcheck_check>` now properly translates to `--suppress <cppcheck_check> in the cppcheck invocation. The current run configuration of cppcheck is `--enable=all`. Added two new input paramaters: With `cppcheck-addons` extra cppcheck checkers can be specified. With `cppcheck-libraries` the cppcheck library definitions can be added. Cppcheck reports have to be "fixed" for Codechecker to be able to properly interpret them. The actual error message must be added to any multistep report as a last bug path event. Cppcheck checkers are prefixed with the `cppcheck-` prefix.
you may consider adding this analyzer option to the cppcheck plugin |
tools/report-converter/codechecker_report_converter/analyzers/cppcheck/analyzer_result.py
Outdated
Show resolved
Hide resolved
output_dir = Path(result_handler.workspace, "cppcheck", | ||
result_handler.buildaction_hash) | ||
output_dir.mkdir(exist_ok=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use os.makedirs
instead, so it creates the parent directories, and then the other call might truly be redundant.
d80db17
to
8a2810d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thansk for the patch!
tools/report-converter/codechecker_report_converter/analyzers/cppcheck/analyzer_result.py
Outdated
Show resolved
Hide resolved
🥳 |
This commit adds support for the Cppcheck analyzer.
The following two commits are also squashed into this:
This commit is the resurrection of works made by Márton Csordás.
The original pull request #2290 had three more refactoring related change
sets which were omitted in this. Some changes were added in compared to
the original commits:
result_handler.
changes in the code base.
Co-authored-by: bruntib bruntib@users.noreply.github.com
Co-authored-by: vodorok vodorok@gmail.com