ignoring false positives

4 views
Skip to first unread message

Vlad

unread,
Nov 2, 2009, 3:18:02 PM11/2/09
to Gendarme
Hi,

If I would like a rule to execute, but I know that it incorrectly
makes a finding for a given method.
Is there a way for me to decorate the method with some attribute
(example follows)?

[IgnoreGendarmeRule(EnsureLocalDisposableRule] // foo is Disposed
elsewhere in method Bar ()
void DoStuff ()
{
IDisposable foo = new Foo ();
DoSomeStuff (foo);
}

Thanks,

Vlad

Sebastien Pouliot

unread,
Nov 2, 2009, 7:20:07 PM11/2/09
to gend...@googlegroups.com

At some point we'll support the [SuppressMessage] attribute that MS use
to ignore defects with FxCop. About 50% of the code is already there.

In the mean time the solution (which, personally, I much prefer to using
attributes) is to use an ignore file, see example in [1], docs in [2].

For 2.8 I plan to write a tool to convert defects into ignore entries.
That will make it easier for people who want to create a baseline on
existing software.

Sebastien

[1]
http://anonsvn.mono-project.com/viewvc/trunk/mono-tools/gendarme/self-test.ignore?view=markup
[2]
http://anonsvn.mono-project.com/viewvc/trunk/mono-tools/gendarme/man/gendarme.5.in?view=markup


Reply all
Reply to author
Forward
0 new messages