2017-08-10 69 views

回答

0

如果您的项目不需要,您可以排除Sona的Spock测试r分析:

sonar.exclusions=src/test/*.groovy 

否则,您应该找到相应的规则并更改默认正则表达式,例如, ^[a-zA-Z0-9]+$。但我不确定你可以专门为groovy测试文件做这件事。

0

我已经配置了Sonarqube忽略声纳的规则“方法名”文件夹中,盖布斯波克脚本存在

它工作正常

要知道如何配置,请按照下列步骤操作:

1.Goto Administration tab->Analysis Scope->Issues 
2.There , you will find "Ignore Issues on Multiple Criteria". 
3.Provide Rule ID in "Rule Key pattern" textbox [Rule ID can be found by clicking on the particular rule and find it in top right 
corner] 
4.Provide Filepath for which you need to ignore rule in "File Path Pattern" textbox 
5.Click on Save Issues settings 

请参考以下图片以知道在哪里可以看到规则名称以及在何处配置路径 Image to know where Rule ID will be present in the page Image where Rule key pattern and File Key pattern text boxes are present