Skip to content

Generated files should include /// <auto-generated/> preamble #273

@AArnott

Description

@AArnott

Describe the Bug

When these source generators are used in a project with Stylecop.Analyzers, diagnostics are produced that can block adoption.

Steps to Reproduce

Install StyleCop.Analyzers into a project that uses the ThisAssembly.Resource package.
Build.

Expected Behavior

No warnings

Actual behavior

Warnings such as this:

ThisAssembly.Resource\ThisAssembly.ResourcesGenerator\ThisAssembly.Resources.EmbeddedResource.cs(8,28,8,35): warning SA1400: Element 'baseDir' should declare an access modifier (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1400.md)

Version Info

1.4.1

Additional Info

By adding /// <auto-generated /> to the top of every emitted file, other analyzers are warned away from reporting frivolous diagnostics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions