roslynator
roslynator copied to clipboard
Add support for default Roslyn analyzer to CLI
Product and Version Used: Roslynator.Commandline 0.1.0
Steps to Reproduce:
Create an empty console project.
Add .editorconfig with csharp_prefer_braces = true:error.
Add line in the code violating this rule.
Run roslynator fix or analyze.
Actual Behavior: IDE0011 (missing if braces) is not shown in the roslynator cli output.
Expected Behavior: All analyzers are supported, even built-in Roslyn analyzer.
Related to https://github.com/dotnet/roslyn/issues/33629 and https://github.com/dotnet/roslyn/issues/2020
It is possible to load IDE.... (and other) analyzers to Roslynator CLI.
You have to use option --analyzer-assemblies.
IDE... analyzer assemblies are located here:
C:\Program Files\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\ManagedLanguages\VBCSharp\LanguageServices
Location can vary depending on OS and VS edition.
Redoing the repro steps with added --analyzer-assemblies pointing to IDE analyzer directory doesn't change the apparent behavior.
@JosefPihrt If this use case works for you with loaded IDE assemblies, the perhaps it's a bug in assembly loading.
@artlaskow Have you tried adding dotnet_diagnostic.IDE0011.severity = error to your EditorConfig?