开发者

How to show all StyleCop warnings for a solution?

开发者 https://www.devze.com 2023-02-18 23:41 出处:网络
If I have 开发者_开发问答2 projects in my solution, and each one of them is configured to run StyleCop, MSBuild will show only warnings for a single project.

If I have 开发者_开发问答2 projects in my solution, and each one of them is configured to run StyleCop, MSBuild will show only warnings for a single project.

Isn't there a way to make it show warnings for every project?


You can use msbuidl and the msbuild extension pack, specifically: MSBuild.ExtensionPack.StyleCop.dll

to analyse a path (alll the code here) e.g.

and send the files to the task

<MSBuild.ExtensionPack.CodeQuality.StyleCop
     TaskAction="Scan"
      ShowOutput="true"
      ForceFullAnalysis="true"
      CacheResults="false"
      SourceFiles="@(SourceFiles)"
      SettingsFile="$(SourceAnalysisSettingsFile)"
      ContinueOnError="false">
             <Output TaskParameter="Succeeded" PropertyName="AllPassed"/>
             <Output TaskParameter="ViolationCount" PropertyName="Violations"/>
             <Output TaskParameter="FailedFiles" ItemName="Failures"/>

</MSBuild.ExtensionPack.CodeQuality.StyleCop>

Hope that gets you started.

0

精彩评论

暂无评论...
验证码 换一张
取 消