0

I have installed StyleCop.Analyzers on my project that is written using C#. The rules severity are set to suggestion.

How can I apply specific rules on the entire project using dotnet format?

I tried executing dotnet format SolutionName.sln --diagnostics SA1122 to convert all "" to string.Empty. Many files were updated (file timestamp changed), but none of the "" were replaced by string.Empty as expected.

How can I use dotnet format to apply specific format rule globally so I don't have to manually make the changes?

1 Answer 1

0

This maybe an issue in the CLI command. It works when used with other arguments like --severity info

dotnet format SolutionName.sln --severity info --diagnostics SA1122
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.