Using the “Ignore Issues on Multiple Criteria” option under Project Settings → Analysis Scope, I can tell SQ to ignore a specific rule for files matching a given regex.
For regex-based rules, what I’d like to do is use one regex for files matching the given pattern, and another regex (such as the default) for any other file. Is this possible?
Specifically, we’re using the Java rules in the low 100’s that refer to naming conventions for field names, method names, etc., which take a regex parameter. For certain groups of files we have valid reasons for violating the standard regex and would like to use a different regex.
If we switch the rule to the new regex then a lot of names in other files would become issues. We could make a regex that ORs the two together, but then any violation of the STANDARD rules in files outside of the special group would be ignored if it happened to conform to the new regex (i.e., a false negative).
We could ignore the rule for the special files but then we’d miss any violations THERE. So adjusting the rule according to the file pattern would be the most optimal.
(If worse comes to worst, we can just script something to pick out the special cases and mark them wontfix using the web_api. But I wanted to check first.)