Skip to content

Fix MSTEST0001 documentation about suppressing #44974

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

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/core/testing/mstest-analyzers/mstest0001.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@ Do not suppress a warning from this rule. Many libraries can benefit from a mass

## Suppress a warning

Violations to this rule cannot be suppressed inline.
Because this rule is reported at the compilation level and not in a *.cs* or *.vb* source file, you can't suppress violations to this rule inline or via an `.editorconfig` file.

To disable the rule for a file, folder, or project, set its severity to `none` in the [configuration file](../../../fundamentals/code-analysis/configuration-files.md).
To disable the rule for a project, add `<NoWarn>$(NoWarn);MSTEST0001</NoWarn>` to the project file or `Directory.Build.props` file.

To control the severity of this rule, you can do it only via a `.globalconfig` file. For more information, see [Configuration files](../../../fundamentals/code-analysis/configuration-files.md#global-analyzerconfig).

```ini
[*.{cs,vb}]
is_global = true

dotnet_diagnostic.MSTEST0001.severity = none
```

Expand Down
Loading