Skip to content
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

How to suppress MSTest analyzer rules? #4615

Open
abatishchev opened this issue Jan 10, 2025 · 2 comments
Open

How to suppress MSTest analyzer rules? #4615

abatishchev opened this issue Jan 10, 2025 · 2 comments

Comments

@abatishchev
Copy link

Unlike the docs for other analyzers, e.g.:

The doc for MSTest analyzer rules, such as MSTEST0024 only says the following:

You can suppress warnings from this rule if you are sure of the behavior does match what you want to do.

I can suppress [the] warnings from this rule. But how?

@Youssef1313
Copy link
Member

Thank you for reporting this @abatishchev

I marked this issue as a documentation issue. But in general it's the same as any warning #pragma warning disable MSTEST0024. Also, you should see a "Suppress or configure issues" -> "Suppress MSTEST0024" if you invoke quick actions in Visual Studio.

@abatishchev
Copy link
Author

I know it's something rather trivial, what makes the question "dumb", but I think it would improve the docs (by up leveling).

Personally, I was looking for a way to suppress certain rules in all test classes using .editorconfig. I don't like "polluting" code with #pragmas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants