SonarQube: How to suppress a warning in Kotlin code

孤者浪人 提交于 2019-12-10 02:59:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!