Ignore Issue on Files feature is not working

We’re on Enterprise Edition of SonarQube 8.3 and I’m trying to allow developers to selectively ignore issue on files by placing the following string at the top of a file: “// SQIgnore”

I’ve configured the “Ignore Issue on Files” to ignore files that contain that string but analysis is still being triggered and they aren’t passing the quality gate like I would expect them to if the file was actually being ignored. Is there something more I need to do?

Hi Brian,

Can you confirm how you attempted to configure this? In the UI, with what value in what configuration entry? The setting should be a valid regular expression.

Here’s my admin screen:

I think you’re missing escaping on your comment slashes. Give this a shot:

\/\/ SQIgnore

Yep, I was. Thanks for the heads up. However, I updated the regex to contain the escape characters and it’s still analyzing files that have // SQIgnore at the top of the file. Maybe I need a more forgiving Regex?
Here’s my updated screen shot.

It worked for me when I tested it; a file with // SQIgnore at the top that contained a bug and a code smell reported no issues afterwards.

To be clear, this ignores issues on the file. Without other settings in place, the file will still factor into coverage & duplication results potentially. I’m not sure what your’e seeing specifically when you say “it’s still analyzing” the files.

Sorry, what I mean by analyzing that it still reports errors/code smells in the file even though we include the // SQIgnore on the file. I guess I’m a bit confused by what you mean about other settings and how the file will still factor into coverage metrics, that’s the exact metric I’m trying to ignore on those files. Is there a better way of removing certain specific files from coverage/duplication results?