dotnet / roslynator

Roslynator is a set of code analysis tools for C#, powered by Roslyn.
https://josefpihrt.github.io/docs/roslynator
Other
3.08k stars 256 forks source link

RCS1016 .editorconfig #681

Open silvioboehme opened 4 years ago

silvioboehme commented 4 years ago

Product and Version Used: VS2019 (16.6.1)

I have found a strange behavior. If i configure the analyzers in a ruleset file and set RCS1016 to "warning", VS2019 (16.6.1) shows this correcty as a warning for a simple one line method and provides the right fix. If i configure the analyzers in .editorconfig and set RCS1016 to "warning", nothing happens. Other analyzers are enabled in the right way, and also the severity seems to be right. Except for RCS1016.
josefpihrt commented 4 years ago

I will look at it.

It is important to mention that Roslynator does not interact with .editorconfig but it uses Roslyn API that allows to obtain effective severity for each analyzer. Which implies that theoretically it could be bug in Roslyn.

caiolmd commented 4 years ago

I also found a problem trying to disable a fade out analyzer through editorconfig. That is not working and the fading is still visible:

dotnet_diagnostic.RCS1058.severity = none dotnet_diagnostic.RCS1058FadeOut.severity = none

josefpihrt commented 4 years ago

@caiolmd "FadeOut" analyzers are marked with NotConfigurable tag which mean that they "cannot be suppressed or filtered or have its severity changed".

Are you trying to use RCS1058 without "fade out" effect? If that is the case then that is not possible.

caiolmd commented 4 years ago

Are you trying to use RCS1058 without "fade out" effect? If that is the case then that is not possible.

@JosefPihrt No, I'm trying to disable RCS1058, which I did, but the "fade out" is still there. RCS1058 is disable but RCS1058FadeOut is not. I'm on VSCode with Omnisharp.

image

hntrewhitt commented 3 years ago

Hey, I have experienced a similar fade out issue - when disabling the analyzer the fade out is still applied:

image

image

But only for the switch statement, if behaves differently:

image