Skip to content

Handle invalid dotnet_diagnostic entry without ID part in configurati…#45615

Merged
1 commit merged intodotnet:masterfrom
mavasani:FixArgException
Jul 2, 2020
Merged

Handle invalid dotnet_diagnostic entry without ID part in configurati…#45615
1 commit merged intodotnet:masterfrom
mavasani:FixArgException

Conversation

@mavasani
Copy link
Contributor

@mavasani mavasani commented Jul 2, 2020

…on code fix

Fixes #45446

@mavasani mavasani added this to the 16.8.P1 milestone Jul 2, 2020
@mavasani mavasani requested review from a team and allisonchou July 2, 2020 16:56
var diagIdLength = key.Length - (DiagnosticOptionPrefix.Length + SeveritySuffix.Length);
var diagId = key.Substring(DiagnosticOptionPrefix.Length, diagIdLength);
if (string.Equals(diagId, _diagnostic.Id, StringComparison.OrdinalIgnoreCase))
if (diagIdLength > 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only change is adding this if check.

@mavasani
Copy link
Contributor Author

mavasani commented Jul 2, 2020

Thanks!

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approval

@ghost ghost merged commit 295eaa6 into dotnet:master Jul 2, 2020
@mavasani mavasani deleted the FixArgException branch July 2, 2020 20:50
@GaTechThomas
Copy link

Does this fix the specific issue? The problem is occurring when the specified line is included in the .editorconfig file (note the leading '#'):

# dotnet_diagnostic.severity = error

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception in VS 2019 when setting analyzer rule severity level.

4 participants