Klaus Byskov Pedersen
Klaus Byskov Pedersen

Reputation: 120917

Globally suppress Code Analysis warning CA1704 across a project or assembly?

I have several Code Analysis CA1704:IdentifiersShouldBeSpelledCorrectly warnings that I want to suppress. Basically, they refer to the company name which is deemed to be spelled incorrectly.

The company name is part of several namespaces in my project, and in order to suppress all of the warnings I need to add a lot of suppressions to the GlobalSuppressions file. Is there any way to suppress all of these warnings in a single line in the GlobalSuppressions file to keep my GlobalSuppressions file from becoming overly cluttered?

Upvotes: 5

Views: 2429

Answers (2)

Mark Seemann
Mark Seemann

Reputation: 233125

You can't suppress many warnings with a single suppression, but when it comes to unknown or deliberate deviant spelling, the best solution is to add a custom Code Analysis dictionary.

Upvotes: 6

Henrik
Henrik

Reputation: 23324

You could add the company name to CustomDictionary.xml

Upvotes: 2

Related Questions