2017-08-10 56 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