gpt4 book ai didi

c# - 在 Sonar 中运行 Stylecop 时,如何让它分析识别为测试项目的项目?

转载 作者:行者123 更新时间:2023-11-28 21:13:23 24 4
gpt4 key购买 nike

好吧,假设我想按规则生活,请像对待生产代码一样谨慎对待您的测试代码。如何让 Sonar 和 Stylecop 分析我的测试项目?

我基本上在我的 sonar-project.properties 文件中写了这个:

#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=

阅读 Sonar 构建日志,我看到除了测试(即 SomeTestProject.Tests)项目之外的所有项目都由 Stylecop 分析。

如何让 sonar+stylecop 也分析我的测试项目?

最佳答案

这似乎在 Sonar 3.3+C# 插件 2.0 中不受支持。将在 2.1 中修复 http://jira.codehaus.org/browse/SONARDOTNT-224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

关于c# - 在 Sonar 中运行 Stylecop 时,如何让它分析识别为测试项目的项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13397622/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com