-
Notifications
You must be signed in to change notification settings - Fork 186
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
Add support for parsing cargo check JSON output #137
Add support for parsing cargo check JSON output #137
Conversation
587ddc7
to
8790310
Compare
Codecov Report
@@ Coverage Diff @@
## master #137 +/- ##
============================================
+ Coverage 87.89% 87.95% +0.06%
- Complexity 1211 1218 +7
============================================
Files 157 158 +1
Lines 3865 3911 +46
Branches 424 427 +3
============================================
+ Hits 3397 3440 +43
- Misses 311 312 +1
- Partials 157 159 +2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #137 +/- ##
============================================
+ Coverage 87.89% 87.95% +0.06%
- Complexity 1211 1218 +7
============================================
Files 157 158 +1
Lines 3865 3911 +46
Branches 424 427 +3
============================================
+ Hits 3397 3440 +43
- Misses 311 312 +1
- Partials 157 159 +2
Continue to review full report at Codecov.
|
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.
Thanks for your PR. The code is very well written! You still can improve the code coverage if you add one or more two test cases, see comments.
I think it makes sense to wait with the associated change in warnings-ng until I publish a snapshot release of your changes.
|
||
/** | ||
* A parser for {@code rustc} compiler messages in the JSON format emitted by {@code cargo check --message-format json}. | ||
* . |
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.
Duplicate .
If you like please add @author
} | ||
} | ||
|
||
return Optional.empty(); |
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.
Any chance to write a test that hits this line?
for (int index = 0; index < spans.length(); index++) { | ||
JSONObject span = spans.getJSONObject(index); | ||
|
||
if (span.getBoolean(MESSAGE_SPAN_IS_PRIMARY)) { |
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.
Any chance to write a test that skips this line once? I.e. that loops for two times?
|
||
/** | ||
* Tests the class {@link CargoCheckParser}. | ||
*/ |
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.
@author
.hasColumnStart(5) | ||
.hasColumnEnd(34); | ||
} | ||
|
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.
It would be helpful to have an additional test that also checks the aggregation, i.e. has a size
of 2 issues.
Can you please also add a line to the ChangeLog? |
Thanks for the review! I'll action these changes a bit later today. |
Adds a parser that can read compiler messages emitted by rustc and clippy in the format used by cargo's `--message-format json` option.
Also updates some javadoc comments to add author tags and remove erroneous punctuation.
7bd6ad0
to
6768bd3
Compare
Thanks! I'll ping you if the release (or snapshot) is published so we can use it in warnings-ng. |
If you want to change something or add icon, help, etc, please file a PR to warning-ng: |
Adds a parser that can read compiler messages emitted by rustc and clippy in
the format used by cargo's
--message-format json
option.This allows producing analysis reports for Rust projects using either the standard
cargo check
functionality, or the clippy tool.Also, I think I need to add the parser definition to the Jenkins
warnings-ng-plugin
too. Should I send a PR for that now or wait until this new parser is available in the latest snapshot of analysis-model?