How to disable Sonar rules for specific files?

后端 未结 6 779
囚心锁ツ
囚心锁ツ 2021-01-03 21:35

I\'ve got a project I\'m working on and some of the files violate some of the rules, but in ways that are not real issues, and are thus distracting noise. However, I don\'t

6条回答
  •  失恋的感觉
    2021-01-03 22:14

    You can annotate a class or a method with SuppressWarnings.

    Here is an example:

    @java.lang.SuppressWarnings("squid:S00111") squid:S00111 in this case is a Sonar issue ID. You can find this issue id from the Sonar web ui.

提交回复
热议问题