-
Notifications
You must be signed in to change notification settings - Fork 383
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
[report-converter] Smatch Parser #2968
Conversation
b7c0c97
to
a48ee8e
Compare
There is already a different pull requests with this support request: #2967. Do you know anything about that @jay24rajput or @bulwahn? Which one should be reviewed? |
Sorry, we are a larger group of developers playing around and implementing some proof of concepts and basic experiments on CodeChecker, and we implemented something here independently twice. |
tools/report-converter/tests/unit/smatch_output_test_files/sample.expected.plist
Outdated
Show resolved
Hide resolved
tools/report-converter/codechecker_report_converter/smatch/output_parser.py
Show resolved
Hide resolved
- Smatch Output is parsed and stored into the format: file:line message - Parser is called from report conveter CLI with type 'smatch'
a48ee8e
to
19420f0
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.
Just some small tiny comments, otherwise LGTM!
tools/report-converter/tests/unit/smatch_output_test_files/files/sample.c
Outdated
Show resolved
Hide resolved
- Smatch Parser is tested with sample.c and sample.out files
- Smatch documentation in report converter explains the usage of smatch tool on kernel sources - Smatch is accessible from the main readme file and supported code analyzer file - Smatch and Coccinelle updated in usage
19420f0
to
7d83246
Compare
@csordasmarton there you go |
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!
- Checker name is included in the parsed smatch output - The message no more displays the function name
@csordasmarton @gyorb @bulwahn I have added support for checker name in smatch as well. Kindly have a look |
@jay24rajput You should also add documentation how smatch will provide the rule name and which commit in smatch is required for that feature. |
tools/report-converter/tests/unit/smatch_output_test_files/sample.out
Outdated
Show resolved
Hide resolved
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.
s/ouput/output
Other than that, looks good to me. |
The patch for checker name hasnt been released yet I guess. How do we make that patch available to the developers? Probably a new smatch github repo with that patch applied? |
Not a good idea; just be patient a few days and Dan will publish it. We just remember to extend documentation as soon as the patch is available in Dan's repository. |
- Smatch Parser tested with sample output containing checker name
ea6c8cc
to
5538d6d
Compare
Here is an overview of what got changed by this pull request: Complexity increasing per file
==============================
- tools/report-converter/codechecker_report_converter/smatch/output_parser.py 3
- tools/report-converter/codechecker_report_converter/smatch/analyzer_result.py 2
- tools/report-converter/tests/unit/test_smatch_parser.py 3
Clones added
============
- tools/report-converter/codechecker_report_converter/smatch/output_parser.py 1
- tools/report-converter/tests/unit/test_smatch_parser.py 3
See the complete overview on Codacy |
@bulwahn I will keep an eye on smatch repository and update the documentation as soon as the patch is released. I have also fixed the error in |
Should we prepare the smatch parser for a report from an older version where the checker name is not yet available in the output or we assume the user uses the latest version with this feature? In that case maybe it would be worth to mention in the documentation which smatch version is supported. |
Yes we assume that the user is on the latest version with the checker name available. The issue is that we are waiting for Dan( the developer of smatch) to actually push the checker name patch to his repository( which he will soon, I assume). Once that is in place, I will update the documentation of smatch accordingly |
@gyorb At this stage, we know all users (@sudipm-mukherjee) and we will only use the latest version as @jay24rajput wrote. The next users are probably still a few months in the future, so we really do not need to support an older version of smatch. The number of smatch users is probably just a few dozen. |
This is ready to be merged from our side. We will already start testing it. |
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!
@bulwahn @gyorb @jay24rajput: I am seeing a problem with this. The checker name from smatch is "smatch.*" like "smatch.check_uninitialized" but the generated report only lists it as "check_uninitialized". Whereas the checker name for clang contains the full checker name. You can see the reports together at https://sudipm-mukherjee.github.io/next-20201021 |
@sudipm-mukherjee That should not be difficult. I just kept it this way so that |
I agree with @sudipm-mukherjee. It seems to make sense to prefix with the tool name; I think for coccinelle, we should also prefix with coccinelle as well. @jay24rajput, will you provide a pull request? |
@bulwahn Alright! I will make the changes and issue a pull request |
Smatch report converter tool for parsing Smatch output of kernel sources