When running Stylecop in Sonar, how do I make it analyze projects identified as test projects?

可紊 提交于 2019-12-25 02:09:47

问题


Ok, so let's assume that I want to live according to the rule, treat your test code as carefully as your production code. How do I make Sonar and Stylecop analyze my test projects?

I've basically written this in my sonar-project.properties file:

#Core C# Settings 
sonar.dotnet.visualstudio.solution.file=SomeSolution.sln 
sonar.dotnet.excludeGeneratedCode=true
sonar.dotnet.version=4.0
sonar.donet.visualstudio.testProjectPattern=*.Tests

#StyleCop
sonar.stylecop.mode=

Reading the sonar build log I see that all projects except the tests (i.e. SomeTestProject.Tests) project are analyzed by Stylecop.

How can I make sonar+stylecop analyze my Tests project as well?


回答1:


Seems this is unsupported in Sonar 3.3+C# plugin 2.0. To be fixed in 2.1 http://jira.codehaus.org/browse/SONARDOTNT-224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel



来源:https://stackoverflow.com/questions/13397622/when-running-stylecop-in-sonar-how-do-i-make-it-analyze-projects-identified-as

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!