How to run a Code Inspection with specific severity settings, e.g. ignore 'Hints'

I know that you can specify the severity for every single rule, which is nice.

Our situation in a team of developers is, that for some rules we do not want to explicitly regulate, that one must apply it or not, because in some situations you do not want to stick to the rule for reasons.

E.g.: - Simplify conditional ternary expressen, or simplify LINQ expression.

We would like to let this rules activated on severity level 'hint' to give every developer the possibility to use it. But we do not want see rule violations in the code analysis / inspection.

Of ourse, I know, we could set pragma things on every place, where we do not want to stick to the hint, but we do not like to pollute our code with that ;)

Long story short: What would be perfect for us, would be a severity level setting for the code inspection, like 'ignore hints'. Is there a possibility?

Official comment

Jannis, there is -severity key for tool which specifies minimal severity level to output.
So, running inspectcode.exe -severity Suggestion ... , will output only Suggestions, Warnings and Errors.

Thanks Slava, that is exactly what I searched for. I already found where I can set the additional flags in teamcity configuration. That works.

One further thing: Is there a way to control flag from VS 2017 via the Resharper menu?

So that every developer sees the corresponding results in the 'Inspection results' window. 


Please sign in to leave a comment.