/warnaserror-:DiagnosticId should not nullify editorconfig diagnostic…#49449
/warnaserror-:DiagnosticId should not nullify editorconfig diagnostic…#49449mavasani merged 3 commits intodotnet:masterfrom
Conversation
… settings for DiagnosticId Fixes dotnet#49446
|
@dotnet/roslyn-compiler for second review. |
1 similar comment
|
@dotnet/roslyn-compiler for second review. |
It looks like we are overriding the Refers to: src/Compilers/CSharp/Portable/Compilation/CSharpDiagnosticFilter.cs:201 in 23dbaaa. [](commit_id = 23dbaaa, deletion_comment = False) |
For example, it is not obvious if we can switch to In reply to: 732285025 [](ancestors = 732285025) Refers to: src/Compilers/CSharp/Portable/Compilation/CSharpDiagnosticFilter.cs:201 in 23dbaaa. [](commit_id = 23dbaaa, deletion_comment = False) |
src/Compilers/VisualBasic/Portable/Compilation/VisualBasicDiagnosticFilter.vb
Outdated
Show resolved
Hide resolved
|
Done with review pass (iteration 1) #Closed |
Thanks, I can refactor so we don't explicitly rely on the behavior of Note that this is already tested via an existing test which passes /warnaserror- without any syntax tree options, so there is no need to add a new test, but your suggested refactoring will make this more explicit.
|
Note, this isn't the only case I am concerned about. It is not clear to me why it would be fine to read ReportDiagnostic.Error from config in our case. In reply to: 732298342 [](ancestors = 732298342) |
I am referring to other values that might come from config, not just lack of a value. In reply to: 732304230 [](ancestors = 732304230,732298342) |
Maybe I am not clear about the exact scenarios that you are concerned about. The logic works as follows:
I can add more tests to assert this behavior. |
|
It is not obvious to me why it is desired to override In reply to: 732320103 [](ancestors = 732320103) |
Sounds good - I don't have a push back to change the semantics so |
… from bumping a warning to an error. Verified that the new test fails for the case `[InlineData(warnAsErrorMinus: true, defaultSeverity: DiagnosticSeverity.Warning, severityInConfigFile: DiagnosticSeverity.Error, expectedEffectiveSeverity: DiagnosticSeverity.Warning)]` prior to the product fix in this commit, as actual effective severity was an error. This is fixed with commit.
| // Verify '/warnaserror-:ID' has no effect when default severity is 'Info' and config file bumps severity to 'Error' | ||
| [InlineData(false, DiagnosticSeverity.Info, DiagnosticSeverity.Error, DiagnosticSeverity.Error)] | ||
| [InlineData(true, DiagnosticSeverity.Info, DiagnosticSeverity.Error, DiagnosticSeverity.Error)] | ||
| public void TestWarnAsErrorMinusDoesNotNullifyEditorConfig( |
There was a problem hiding this comment.
@AlekseyTs Please let me know if you feel there are more combinations that would be worth testing.
|
Thanks! |
… settings for DiagnosticId
Fixes #49446