does ignore file take any wildcard chars?

252 views
Skip to first unread message

vg

unread,
Mar 14, 2011, 5:08:20 PM3/14/11
to Gendarme
Hi,

Can we add wildcard characters in the gendarme.ignore file so as to
exclude a method by its signature and not the fullname (mentioning
namespace, type etc)?

For example, for a particular rule, if I want to exclude all methods
having the name InitializeComponent(), irrespective of the assemblies
they are in......is there a way to do that using wildcard characters,
instead of specifying each one of them with their full names...(the
usual way of ignoring methods)

Thanks,

Sebastien Pouliot

unread,
Mar 14, 2011, 5:28:51 PM3/14/11
to gend...@googlegroups.com
On Mon, 2011-03-14 at 14:08 -0700, vg wrote:
> Hi,
>
> Can we add wildcard characters in the gendarme.ignore file so as to
> exclude a method by its signature and not the fullname (mentioning
> namespace, type etc)?

The only wildcard presently supported is for a lone * for assemblies,
e.g. "A: *"

This is useful when you want to ignore a rule for every assemblies
without a custom rules.xml file.

> For example, for a particular rule, if I want to exclude all methods
> having the name InitializeComponent(), irrespective of the assemblies
> they are in......is there a way to do that using wildcard characters,
> instead of specifying each one of them with their full names...(the
> usual way of ignoring methods)

That could be useful (even if I fear it will be often misused, adding
entries force you to consider each case ;-)

Please fill a bug report, Enhancement, for this. Instructions (if
needed) are available @
https://github.com/spouliot/gendarme/wiki/BugReports

Thanks!
Sebastien

Calvin Rien

unread,
Mar 15, 2012, 5:46:40 PM3/15/12
to gend...@googlegroups.com, sebastie...@gmail.com
Weird that I would find this post exactly a year and a day later.

Was this feature request ever entered/addressed?  I'm using Gendarme with the Unity engine (Mono FTW), which calls specific private methods of MonoBehaviours via reflection.  This means these methods should never generate Gendarme.Rules.Performance.AvoidUncalledPrivateCodeRule, or Gendarme.Rules.Correctness.MethodCanBeMadeStaticRule warnings.  

There's a very short list of methods that should be exempt, and they should be skipped on anything that inherits from MonoBehaviour.  Is there a way to do that with ignore lists yet?

Calvin
p.s. I recently wrote a plugin for the Unity engine that makes generating Gendarme reports easier.  It has really been a boon to my code quality (and hopefully others), my thanks to the authors.

Calvin Rien

unread,
Mar 15, 2012, 10:45:26 PM3/15/12
to gend...@googlegroups.com, sebastie...@gmail.com
I found krijesta's pull request which basically does exactly what I need.


I got that working with the 2.10 version of Gendarme and I'm happy.


Thanks,
Calvin
Reply all
Reply to author
Forward
0 new messages