-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add suppressor support for dotnet format
#48512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
1 similar comment
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
dotnet-format
dotnet-format
dotnet format
457ef9e
to
119a5ee
Compare
119a5ee
to
4940ff7
Compare
dd365ae
to
cca26de
Compare
cca26de
to
92a8b0d
Compare
…sdk into dotnet-format-suppressor-support
cc @tmat |
Context:
Microsoft.Unity.Analyzers is able to add Unity-specific diagnostics or to remove general C# diagnostics that do not apply to Unity projects (through diagnostic suppressors).
One common usage is to run the
dotnet format
command on a unity solution to ensure projects obey the.editorconfig
linting rules:dotnet format --verify-no-changes --severity warn
But currently this command does not support diagnostic suppressors, which implies a lack of consistency with our IDEs and command-line build tools, which now manage suppressors.
See microsoft/Microsoft.Unity.Analyzers#387 for a minimal repro.
Other scenarios are likely to be similar, such as the linting of test projects (
NUnit
andXUnit
make use of diagnostic suppressors).For this PR we tried to have a minimal impact, by just registering local project suppressors, when running the
code-style phase.
Added unit tests as well.
fixes dotnet/format#1998
fixes microsoft/Microsoft.Unity.Analyzers#387
fixes #44867