问题
I'm using SQ 7.3-alpha1 with sonar-kotlin-plugin-1.0.1.965.jar. However, I cannot deactivate a special warning inside my Kotlin code for repositories in Spring Data where I need an "_" in a method name.
I tried both //NOSONAR
and @Suppress("kotlin:S100")
and @SuppressWarnings("kotlin:S100")
. Any hint is appreciated.
回答1:
You're not able to deactivate that issue because none of the mechanisms you're trying to use have been implemented for Kotlin.
Instead, you'll have to do this from the UI side.
回答2:
Great news, https://jira.sonarsource.com/browse/SONARSLANG-373 is fixed in version 1.6 of Sonarslang. So an update to that version might improve the situation. I’ve not tested it yet, hence the cautious wording.
来源:https://stackoverflow.com/questions/51646917/sonarqube-how-to-suppress-a-warning-in-kotlin-code