DotNetAnalyzers / StyleCopAnalyzers

An implementation of StyleCop rules using the .NET Compiler Platform
MIT License
2.66k stars 508 forks source link

SA1200 (Using directives must be placed correctly) is firing in file with only global usings #3875

Open bjornhellander opened 4 months ago

bjornhellander commented 4 months ago

I would rather keep global using statements in source files instead of in project files, but centralized in one GlobalUsings.cs file (or something similar) to make them easy to maintain. This also avoids the current problems with mixing normal and global usings in the same file. But a file with only global using statements in it triggers SA1200 with version 1.2.0-beta.556.

Would an exception to SA1200 be ok for files that contain nothing but global using statements and whitespace?