-
Notifications
You must be signed in to change notification settings - Fork 4
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
Read issue severity from issue element rather than issue type element if present #307
Conversation
Thanks a lot for your contribution! |
Absolutely, I understand. No rush necessary, we can get by in the meantime. |
src/NVika.Tests/Data/TestClass.txt
Outdated
@@ -0,0 +1,11 @@ | |||
namespace InspectCodeTest | |||
{ | |||
public class TestClass |
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.
Could you rename the file and class to something more meaningful, maybe like Convert
?
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.
Have renamed to Conversions
, hopefully that's a bit more fitting.
(Incidentally, when updating references, I've had a bit of trouble with the parser assuming that line endings are always 1 character, which is not the case on Windows. This is probably not a huge issue because most git repositories are likely to be configured to core.autocrlf
correctly, and also out of scope of this pull, but I figure I may as well bring it up.)
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 the heads-up!
Thanks a lot for this fix! |
Hi,
I am a contributor on a few projects, where we use NVika for parsing InspectCode reports. Today, we've encountered a situation wherein bumping one inspection's severity level to warning would show them as warnings in Rider, but the NVika parsed output would show them as suggestions.
The immediate cause of that, it seems, is that we have both an
.editorconfig
file, as well as a.DotSettings
file, which happened to have conflicting severity levels. InspectCode handles that by giving precedence to.editorconfig
, as well as attaching aSeverity
attribute to the issue at hand (rather than the issue type):(source for quotation)
This PR aims to follow that standard by reading and then giving precedence to the
Severity
attribute value if it is present on an<Issue>
element, and only then falling back to theSeverity
read from the<IssueType>
if the issue had no explicit severity.I've attached a test case for this, but am unsure if it's packaged in the proper manner. Please advise if you would like to see adjustments to it. The code for the test is... a stretch, but I couldn't come up with a better illustrative example.