简体   繁体   English

如何将CodeNarc规则添加到Sonar Groovy插件

[英]How to Add CodeNarc Rules to Sonar Groovy Plugin

CodeNarc has 346 rules, but the Sonar Groovy plugin (which utilizes CodeNarc) only uses 59 of those rules. CodeNarc有346条规则,但是Sonar Groovy插件(利用CodeNarc)仅使用其中59条规则。

I need to add more rules in Sonar to the Groovy analysis. 我需要在Sonar中向Groovy分析添加更多规则。 How can I do this? 我怎样才能做到这一点?

Thanks 谢谢

I think you are talking about the default quality profile of the Sonar Groovy Plugin which indeed activate only 59 rules by default (as you can see on nemo (public instance of SonarQube analyzing open source projects)) 我认为您正在谈论的是Sonar Groovy插件的默认质量配置文件,该插件实际上默认情况下仅激活59条规则(如nemo (用于分析开源项目的SonarQube的公共实例)所示)

The other rules of CodeNarc would be available in the rules section. CodeNarc的其他规则将在“规则”部分中提供。 You can see them by filtering by language and rule repository : http://nemo.sonarqube.org/coding_rules#languages=grvy|repositories=grvy 您可以通过按语言和规则存储库进行过滤来查看它们: http : //nemo.sonarqube.org/coding_rules#languages=grvy| repositories= grvy

To use them you need to activate those rules in a quality profile and set it for your project : see the documentation of quality profile for this. 要使用它们,您需要在质量配置文件中激活这些规则并为您的项目进行设置:为此,请参见质量配置文件文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM