Is it possible to suppress a specific gendarme defect message? I would like to do this in the source code with a flag or something like it.
As poupou already noted, version 2.10 supports the [SuppressMessage] attribute.
For example, to suppress the AvoidNonAlphanumericIdentifierRule rule, do this:
[SuppressMessage("Gendarme.Rules.Naming", "AvoidNonAlphanumericIdentifierRule")]
protected void Application_Start()
{
...
}
Note that you need to specify the name of the assembly where the rule lives... in this case, AvoidNonAlphanumericIdentifierRule lives in Gendarme.Rules.Naming.dll. The full list of rules and their assembly names are here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With