Skip to content

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