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

Empty files should not be analyzed #1040

Closed
sharwell opened this issue Jul 24, 2015 · 4 comments
Closed

Empty files should not be analyzed #1040

sharwell opened this issue Jul 24, 2015 · 4 comments
Assignees

Comments

@sharwell
Copy link
Member

Currently some files are being analyzed when they are completely empty (an example appears in #1039).

If a file consists of nothing but whitespace and/or newlines, no warnings should be reported.

@pdelvo
Copy link
Member

pdelvo commented Jul 24, 2015

grabbed

@sharwell
Copy link
Member Author

@pdelvo This is as good a time as any to move this analysis up into DiagnosticVerifier.

@pdelvo
Copy link
Member

pdelvo commented Jul 24, 2015

I'm going to add a few tests for auto generated files

@sharwell
Copy link
Member Author

I'm thinking if VerifyCSharpDiagnosticAsync is called and the expected results contain one or more diagnostic starting with SA or SX, we could automatically run a second test on the same input with /// <auto-generated> added to the beginning and ensure that the result:

  1. Does not include anything from the expected results which starts with SA or SX.
  2. Does include everything else from the expected results, but with the locations incremented by one line.

This would allow us to automatically check every diagnostic for compliance with the generated code exclusion mechanism without actually writing full tests for each one.

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

No branches or pull requests

2 participants