I gotcha.

Rather than create a customized Gendarme version, I just implemented
my own rule to turn it on.


using Gendarme.Framework;
using Gendarme.Framework.Engines;

namespace MyRules
{
   [Problem("Gendarme devs forgot to attribute rules with
SuppressMessageEngine")]
   [Solution("Include this rule")]
   [EngineDependency(typeof(SuppressMessageEngine))]
   public class AddSuppressMessageSupportRule : Rule {}
}


Also documented over on StackOverflow:
http://stackoverflow.com/questions/2637876/suppress-gendarme-defect



Thanks for the assistance.


On Dec 29, 12:03 pm, Sebastien Pouliot <[email protected]>
wrote:
> On 2010-12-29, at 11:47, Iristyle <[email protected]> wrote:
>
> > FYI -
>
> > It appears you guys are missing [EngineDependency
> > (typeof(SuppressMessageEngine))] on all of your compiled rules.
>
> not quite - there's no dependency between the rules themselves and that 
> engine.
>
> > I see that the tests manually add the engine via
> > Runner.Engines.Subscribe
> > ("Gendarme.Framework.Engines.SuppressMessageEngine") -- but that in
> > the real runner, EngineDependencyAttribute is reflected on for each
> > rule to determine whether to add it to the runner.  Since there are no
> > such attributes applied anywhere, the engine is never added /
> > FxCopCompatibility attributes are ignored, etc.
>
> It's a known bug and will be fixed for 2.10 (or a preview before that).
>
> > As a workaround, I *think* I can create a quicky and dirty hack rule
> > just to enable SuppressMessageEngine.
>
> That should work for 2.8. Adding the attribute to any existing rule is
> another workaround *which requires to re-compile gendarme).
>
> > Am I missing anything / is there an alternate approach to enabling
> > this engine?  Or was this left out intentionally?
>
> Not intentionally ;-) but I did not like the original 'start me up'
> code (so it was not committed) and I forgot about it later (since it
> works so well from unit tests :-)
>
> Sebastien
>
>
>
>
>
>
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Gendarme" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/gendarme?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Gendarme" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/gendarme?hl=en.

Reply via email to