Skip analysis on documents whose MSBuild item carries ExcludeFromStyleCop=true metadata
See original GitHub issueThe original StyleCop would not produce any messages regarding documents that were brought in via MSBuild items that had ExcludeFromStyleCop=true metadata, such as:
<Compile Include="..\SomeSharedFile\CanonicalError.cs">
<Link>Shared\CanonicalError.cs</Link>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
StyleCop.Analyzers does not yet honor this metadata.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
MSBuild Well-known Item Metadata
Item metadata are values attached to items. Some are assigned by MSBuild to items when items are created, but you can also define...
Read more >MSBuild Items
Learn how to use the MSBuild items, item types, and work with lists of items by using and modifying item metadata.
Read more >msbuild: How to extract items without metadata?
I created a sequence (inside a Target) that renames files that have the "Rename" metadata. <ItemGroup> <FilesToRename Include="@(ChangeLogs-> ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would like to raise attention to this missing feature - I’m considering StyleCopAnalyzers for an existent solution with a very large codebase (dozens of projects with thousands of files) and it’s not viable to enforce rules on all pre-existent project files - but we would like to enforce them on newly added files.
Not having this feature completely annihilates applying StyleCopAnalysers on this kind of pre-existent projects - the Why’s? from original StyleCop: https://stylecop.codeplex.com/wikipage?title=Using StyleCop on Legacy Projects
One possible solution to this could be achieved by having the ignored files or folders in the stylecop.json configuration.
Closing as a duplicate of dotnet/roslyn#3705.