1

Is it possible to Suppress Warnings in properties file? Warnings are generated by SonarQube Java Properties Plugin.

Warning key *jproperties:** is (for example jproperties:key-naming-convention)

I tried to add comment with

#@SuppressWarnings("jproperties:key-naming-convention")

Before offending line but it does not work.

I know I could do one of

  1. disable those rules in my quality profile
  2. suppress warning in Sonar Web UI

I do not want solution 1) because it will ignore rule for all files, not just for single place.

I do not like solution 2) because I have separate sonar project for each branch (master, develop, feature branches) and separate project for each developer (for ad-hoc analysis). I do not want to suppress warnings in webUI for each project separately, I prefer to suppress warnings once-in source code.

Bartosz Bilicki
  • 12,599
  • 13
  • 71
  • 113
  • For android project you can do this from the sonar.gradle file as well. https://stackoverflow.com/a/71553489/6209105 – Shaikh Mohib Mar 21 '22 at 06:34

1 Answers1

4

It is not possible and there's no plan to add such a feature. The only thing that you might want to do is to exclude this rule for this very specific file by setting exclusions: http://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-IgnoreIssues (Ignore Issues on Multiple Criteria criterion)