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

Remove '*.g.cs' and '*.g.i.cs' from the list of files which are considered generated #851

Closed
sharwell opened this issue May 17, 2015 · 2 comments · Fixed by #874
Closed
Assignees
Milestone

Comments

@sharwell
Copy link
Member

This issue relates to the exclusion of particular files from analysis according to their filenames (see #836). It specifically covers the following patterns:

  • *.g.cs
  • *.g.i.cs

The filename-based exclusion is not necessary because the code generators which produce these files include <auto-generated> in a comment at the top of the file.

@AArnott
Copy link
Contributor

AArnott commented May 17, 2015

It makes sense that we can remove these.
The only possible reason I can think of to remove them is that a filename check is faster than searching the document header for a substring inside it. But I think our design hinges on that header check being fast anyway, so it's probably a non-issue. I support your goal of reducing the list of filename patterns.

@sharwell sharwell self-assigned this May 24, 2015
sharwell added a commit to sharwell/StyleCopAnalyzers that referenced this issue May 24, 2015
This change removes the automatic exclusion for all filenames where no
specific example of this requirement could be found. The code generators
for the files that are not eligible for analysis use <auto-generated>
(or <autogenerated>) in the generated code, which causes the exclusion
to occur by content instead.

Fixes DotNetAnalyzers#848
Fixes DotNetAnalyzers#849
Fixes DotNetAnalyzers#850
Fixes DotNetAnalyzers#851
Fixes DotNetAnalyzers#854
@sharwell
Copy link
Member Author

For now, this exclusion has been removed. If it's reported as necessary in the future, we can easily add it back and we'll also have the advantage of having a record of the reasons each exclusion exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants