Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReSharper: any other way to suppress a warning other than with a comment?

I am getting ReSharper warning which I would like to suppress in this particular case (but not for the entire project). At the moment the only way to do it is to suppress it with a comment. However it looks ugly!

// ReSharper disable StaticFieldInGenericType
        private static int count;
// ReSharper restore StaticFieldInGenericType

I simply don't like to see these ReSharper comments in my code.

Is it somehow possible to keep these settings in a separate file, e.g. - SupressedInspections.ReSharper, etc?

like image 222
niaher Avatar asked Dec 05 '13 11:12

niaher


1 Answers

No, you can only disable it inline with the comments. The best you can do is use ReSharper 8's terser, one line version:

// ReSharper disable once StaticFieldInGenericType
like image 167
citizenmatt Avatar answered Oct 26 '22 16:10

citizenmatt