question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Skip analysis on documents whose MSBuild item carries ExcludeFromStyleCop=true metadata

See original GitHub issue

The 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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
brunocunhasilvacommented, Feb 9, 2017

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.

0reactions
sharwellcommented, Jun 24, 2017

Closing as a duplicate of dotnet/roslyn#3705.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found