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.
Asked
Active
Viewed 2,682 times
10

Michiel Leegwater
- 1,172
- 4
- 11
- 27

Juergen Zimmermann
- 2,084
- 7
- 29
- 43
2 Answers
6
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.

G. Ann - SonarSource Team
- 22,346
- 4
- 40
- 76
-
3Is there any plan to implement issue suppression for Kotlin @g-ann-sonarsource-team? Suppressing it in the UI is not always a feasible option. – Kutzi Jan 30 '19 at 11:07
-
2ditto...we need @Suppress to work for sonar warnings in kotlin files – kenyee Mar 21 '19 at 14:16
-
1@G. Ann - SonarSource Team do you plan to support suppressions for Kotlin? Do you have a ticket? It is very inconvenient and made us disable Kotlin plugin to pass the quality gate on our project. – Kirill Liubun Apr 10 '19 at 09:27
-
1Is this reported in an issue tracker somewhere? It's better to be able to suppress warnings directly in the code, so it's not tied to a particular sonar instance. – Carmen May 03 '19 at 13:49
-
1Hi @g-ann-sonarsource-team can you tell use how to open a bug for this? The SonarKotlin page here https://www.sonarsource.com/products/codeanalyzers/sonarkotlin.html leads to https://github.com/SonarSource/slang/ which doesn't have a bug tracker. Then there's https://docs.sonarqube.org/display/PLUG/SonarKotlin which leads to https://jira.sonarsource.com/projects/SONARSLANG/issues/SONARSLANG-372?filter=allopenissues which is apparently private... How to reach SonarSource about this issue? – BoD May 09 '19 at 09:07
-
1Thanks! Here's the community question: https://community.sonarsource.com/t/how-to-ignore-a-specific-warning-in-kotlin-code/9573 – BoD May 09 '19 at 14:25
-
The above issue is to add support for `// NOSONAR`. Another community question: https://community.sonarsource.com/t/support-suppress-for-the-sonarqube-kotlin-analyzer/11829 , requests support to suppress specific rules with `@Suppress("IssueId")`. The sonar team hasn't created an issue for it (yet -- your votes on the community question may help convince them ;) ) – Carmen Jul 16 '19 at 15:19
0
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.

Michiel Leegwater
- 1,172
- 4
- 11
- 27