In an Android project with Kotlin and using SonarQube, I’m trying to exclude only one rule from some specific files, however it is not working and I haven’t been able to find too much information in the documentation, here is my current configuration inside sonar-project.properties file:
sonar.issue.ignore.multicriteria=e1
sonar.issue.ignore.multicriteria.e1.ruleKey=kotlin:UnnecessaryAbstractClass
sonar.issue.ignore.multicriteria.e1.resourceKey=**/di/**
The rule is supposed to keep SonarQube from running UnnecessaryAbstractClass rule in all files under the di package since Hilt which I’m also using, requires some abstract classes and that would be perfectly fine. However it doesn’t seem to work.
My guess is that the ruleKey is not properly specified, but I’m not sure which ruleKey to use or maybe a different approach would work better.
I already reied the following:
@SuppressWarnings("UnnecessaryAbstractClass")
This works, but I would have to go class by class suppressing the annotation so that’s far from ideal 🙂
Thanks in advance