roslynator icon indicating copy to clipboard operation
roslynator copied to clipboard

Add support for default Roslyn analyzer to CLI

Open artlaskow opened this issue 5 years ago • 3 comments
trafficstars

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

artlaskow avatar Jul 23 '20 20:07 artlaskow

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.

josefpihrt avatar Aug 31 '20 13:08 josefpihrt

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 avatar Sep 18 '20 13:09 artlaskow

@artlaskow Have you tried adding dotnet_diagnostic.IDE0011.severity = error to your EditorConfig?

xtqqczze avatar Dec 23 '20 21:12 xtqqczze