Sonar 2.9不会导入SuppressionFilter

时间:2011-12-24 05:57:07

标签: sonarqube checkstyle static-code-analysis

我正在尝试使用checkstyle规则xml在Sonar 2.9中创建新的规则配置文件。当我尝试导入配置了抑制过滤器的checkstyle规则文件时,声纳会给我以下消息:

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]

我现在对SuppressionCommentFilter并不感到困扰,但是如何启用SuppressionFilter?如果不可能,是否有其他方法可以从Sonar中的特定检查中排除特定文件?

1 个答案:

答案 0 :(得分:2)

你可以set the Suppression(Comment)Filters manually: 转到配置 - &gt;常规设置 - &gt; Java - &gt; CheckStyle的。有一个输入框。将checkstyle.xml文件中的<module>定义粘贴到输入框中。相对路径是从.sonar文件夹解释的。这个功能出现在你的2.9中,我认为它是在2.3上添加的。

出于我的所有目的,这个功能就足够了。据我所知,实际上导入过滤器模块定义是不可能的。可能是较新版本的Sonar可以做到这一点。