This post originated from an RSS feed registered with .NET Buzz
by Mark Levison.
Original Post: Ignore Attribute for FxCop?
Feed Title: Mark Levison
Feed URL: /WebLog/error.aspx?aspxerrorpath=/WebLog/mlevison/Rss.aspx
Feed Description: Musings on No Touch Deployment, .NET development and photography
As I much as I love FxCop I find it difficult to maintain exclusions when we
rename class/methods/variables. I think the underlying problem is that we can
only record exclusions in the FxCop project XML file. When a name changes all
previously excluded items reappear causing developers to curse the fact that
they renamed the method. An elegant solution to this problem would involve an
FxCop ignore attribute, for example:
[FxCopIgnore(" UsePropertiesWhereAppropriate", "Method has a non-trivial
cost")] public void SetCellHeight(int height)
{ .... }
Now when FxCop runs it would find the attribute and ignore the method. Prior
art exists in the form of the pragma's that we used to in C++ to turn off
specific warnings.