RS0016 not recognized using --diagnostics in v6
See original GitHub issueIn the latest v5 I was using the following to execute the code fix of RS0016
through the CLI:
dotnet format SolutionFile.sln --fix-analyzers warn --diagnostics RS0016
Now I’m using the builtin version of .NET 6 and adjusted the syntax to the following:
dotnet format SolutionFile.sln analyzers --diagnostics RS0016
However now I’m receiving the following error:
Unrecognized command or argument ‘RS0016’
The Code-Fix doesn’t seem to execute at all, even if I use dotnet format analyzers
without the --diagnostics
filter:
dotnet format SolutionFile.sln analyzers
I also tried to play around with the --severity
without success. Am I doing something wrong? Is this no longer possible?
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
"Analyzer with Code Fix" project template is broken
Short question: How to setup a roslyn code analyzer project with a working unit-test project in Visual Studio 2019 v16.6.2? A few months...
Read more >MATLAB Simulation of Grid-Connected Photovoltaic System
In this paper work will be briefly covered the principle of operation of photovoltaic system, the procedure of integration of such power plants...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m also running into this issue with .net sdk
6.0.300
and the work around isn’t working for me. Things I’ve tried so far:dotnet format analyzers MySolution.sln --diagnostics="SA1028 SA1107"
produces:Unrecognized command or argument 'SA1028 SA1107'
dotnet format analyzers --diagnostics="SA1028 SA1107"
produces:Unhandled exception: System.IO.FileNotFoundException: The file 'SA1028 SA1107' does not appear to be a valid project or solution file.
dotnet format analyzers --diagnostics=SA1028
producesUnhandled exception: System.IO.FileNotFoundException: The file 'SA1028' does not appear to be a valid project or solution file.
dotnet format analyzers --diagnostics SA1028
producesUnhandled exception: System.IO.FileNotFoundException: The file 'SA1028' does not appear to be a valid project or solution file.
It was a breaking change in 6.x. After merging https://github.com/dotnet/format/pull/1291 we only apply code fixes for diagnostics explicitly configured in the .editorconfig, since analyzer packages can specify their own defaults, this ensures that only the analyzer rules that your team has discussed and that you really care about are being enforced.