Skip to content
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

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

Merged
1 commit merged into from
Jul 2, 2020

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 allisonchou and a team July 2, 2020 16:56
@@ -488,10 +488,13 @@ private async Task<Solution> ConfigureAsync()
key.EndsWith(SeveritySuffix, StringComparison.Ordinal))
{
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