Disable CLion "unused include directive" inspection for a line or a file
Answered
I have a set of tests in a project. These tests purposefully include tested header twice to make sure include guards are in place. CLion warns about unused include directive because it assumes that the first include is enough. This is useful inspection in other cases but in this particular case it is really not. So is it possible to disable this inspection for a line or a file?
Please sign in to leave a comment.
Hello!
You can suppress an inspection for file/function/line - https://www.jetbrains.com/help/clion/disabling-and-enabling-inspections.html#suppress-in-editor.
Anna,
Thanks for the response. Unfortunately there is no Suppress option from the IDE for this type of warning.
@... indeed some inspections cannot be disabled or suppressed, and "unused include directive" is among them, sorry for misleading. It means there is no way to suppress/disable this inspection for a line or a file.
Anna Falevskaya that's a bummer. Are there some technical problems that make this inspection unsuppressible? Maybe JB could make it suppresible in one of the following versions?