Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comments to ignore StyleCop warnings #17

Merged
merged 2 commits into from
Oct 11, 2024
Merged

Conversation

bfriesen
Copy link
Contributor

The StyleCop analyzers pick up on the files from PolyShim and flag a bunch of warnings. To reproduce, add the following <ItemGroup> to a csproj file:

<PackageReference Include="PolyShim" Version="1.14.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

In order to ignore a file, StyleCop needs a "header comment" containing the sub-string "<auto-generated/>". This pull request adds that header comment to all generated files.

In order to ignore a file, StyleCop needs a header comment containing
the sub-string "<auto-generated/>".
@Tyrrrz
Copy link
Owner

Tyrrrz commented Oct 10, 2024

Hi. Thanks for the PR. Can you please replace This file was generated by the PolyShim library. with The following comment is required to instruct analyzers to skip this file?

@Tyrrrz Tyrrrz added the bug Something isn't working label Oct 10, 2024
@bfriesen
Copy link
Contributor Author

Done.

@Tyrrrz
Copy link
Owner

Tyrrrz commented Oct 11, 2024

Thank you

@Tyrrrz Tyrrrz changed the title Fix StyleCop warnings Add comments to ignore StyleCop warnings Oct 11, 2024
@Tyrrrz Tyrrrz merged commit 4505056 into Tyrrrz:master Oct 11, 2024
5 checks passed
@bfriesen bfriesen deleted the stylecop branch October 29, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants