1

I am trying to create new rules profile in Sonar 2.9 with my checkstyle rules xml. When I try to import a checkstyle rules file with suppression filter configured, sonar gives me following messages:

Profile 'test2' created. Set it as default or link it to a project to use it for next measures.   [hide]
Checkstyle filters are not imported: SuppressionCommentFilter
Checkstyle filters are not imported: SuppressionFilter   [hide]

I am not bothered about SuppressionCommentFilter for now, but how to enable SuppressionFilter? If it is not possible, is there any other way to have a similar functionality of excluding specific files from specific checks in Sonar?

4

1 に答える 1

3

Suppression(Comment)Filters を手動で設定できます: Configuration -> General Settings -> Java -> CheckStyle に移動します。入力ボックスがあります。<module>checkstyle.xml ファイルの定義を入力ボックスに貼り付けます。相対パスは、.sonar フォルダーから解釈されます。この機能は 2.9 にあり、2.3 で追加されたと思います。

私の目的には、この機能で十分でした。私の知る限り、フィルター モジュール定義を実際にインポートすることはできません。ただし、Sonarの新しいバージョンでそれができるかもしれません。

于 2012-03-31T21:21:39.207 に答える