Daily Usage Issues

Ruleset files using include

Started by mathiasv on 4,468 views

It seems ncrunch doesn't properly detect and copy ruleset files that are included inside other ruleset files, resulting in a bunch of warnings being output when they should be supressed.

An example scenario, is using stylecop, but wanting to suppress certain rules, for example in tests:

<RuleSet Name="StyleCop Tests Rule Set" Description="These rules focus on enforcing a consistent code style in tests." ToolsVersion="15.0">
<Include Path="stylecop.ruleset" Action="Default" />
<Include Path="stylecop.nodocs.ruleset" Action="Default" />
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1118" Action="None" />
</Rules>
</RuleSet>


The rules specified directly in this file work, but those coming from Include do not.
I can imagine this is because they are not copied to ncrunch's workspace.

I know that I could go in and tell ncrunch to explicitly include this, but that is easier said than done if working with multiple projects that all use the same ruleset.
Thanks for sharing this. I'm not sure how easily this can be resolved to a specific file using NCrunch's MSBuild integration, but will put it on the list to take a look. 'Additional files to include' is the correct workaround for now.

Post a reply

Log in to reply.