|
|
|
I like the attributes idea for places where we already want/need such an attribute, but when we are not using those attributes, I think a cleaner approach is to use a commenting syntax. For example the following code would generate a warning that the code is suppressing all errors:
try If the user elects to ignore only this instance of the warning then Resharper could insert a comment as follows. try This both make the code explicit and tells Resharper to not warn on this line in the future: Note that the XXXX represents some character sequence that Resharper would recognize. This way the end user can modify the actual text of the comment if they wished w/o affecting Resharpers ability to recognize its intent. How does IDEA track these sorts of things (IDE warnings, not compiler warnings)? It seems to allow ignoring specific instances of warnings without adding anything to the code.
Could this be portable between IDE instances, perhaps using a human-readable file that would be included in version control? We are still investigating the best way to resolve this issue
|
|||||||||||||||||||||||||||||||||||||||||||||||||
For example I have this code. The property isn't used directly, but indirectly via reflection.
private class ...
{
// This property is used indirectly by the data grid.
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
public int EventSignificanceId
{
get { return _eventSignificanceId; }
}
}
So in this case I can suppress individual FxCop warnings but not Resharper warnings.