Summary
Analyzer-enabled builds currently fail on existing SA1200 violations in src/NzbDrone.Common.
SA1200 requires using directives to appear within a namespace declaration, but the current codebase still has many files that use the older file layout.
Repro
Run:
dotnet build src/NzbDrone.Core.Test/Radarr.Core.Test.csproj --no-restore -clp:ErrorsOnly
Current result
The build reports 492 SA1200 errors across 139 files, all under src/NzbDrone.Common.
Representative failures:
src/NzbDrone.Common/ArchiveService.cs
src/NzbDrone.Common/Cache/Cached.cs
src/NzbDrone.Common/Cache/CachedDictionary.cs
src/NzbDrone.Common/Cache/CacheManager.cs
src/NzbDrone.Common/Composition/AssemblyLoader.cs
src/NzbDrone.Common/ConsoleService.cs
src/NzbDrone.Common/Crypto/HashProvider.cs
src/NzbDrone.Common/Disk/DiskProviderBase.cs
src/NzbDrone.Common/Serializer/System.Text.Json/STJson.cs
src/NzbDrone.Common/ServiceProvider.cs
Example error:
error SA1200: Using directive should appear within a namespace declaration
Impact
This is unrelated to issue #1, but it blocks analyzer-enabled test and build runs. Local validation for parser work had to use -p:RunAnalyzers=false to avoid these pre-existing failures.
Suggested follow-up
- decide whether the repo wants to keep enforcing
SA1200
- if yes, migrate the remaining
NzbDrone.Common files to the expected namespace/using layout
- if no, update the StyleCop configuration so analyzer-enabled builds reflect the intended repository standard
Summary
Analyzer-enabled builds currently fail on existing
SA1200violations insrc/NzbDrone.Common.SA1200requiresusingdirectives to appear within a namespace declaration, but the current codebase still has many files that use the older file layout.Repro
Run:
Current result
The build reports
492SA1200errors across139files, all undersrc/NzbDrone.Common.Representative failures:
src/NzbDrone.Common/ArchiveService.cssrc/NzbDrone.Common/Cache/Cached.cssrc/NzbDrone.Common/Cache/CachedDictionary.cssrc/NzbDrone.Common/Cache/CacheManager.cssrc/NzbDrone.Common/Composition/AssemblyLoader.cssrc/NzbDrone.Common/ConsoleService.cssrc/NzbDrone.Common/Crypto/HashProvider.cssrc/NzbDrone.Common/Disk/DiskProviderBase.cssrc/NzbDrone.Common/Serializer/System.Text.Json/STJson.cssrc/NzbDrone.Common/ServiceProvider.csExample error:
error SA1200: Using directive should appear within a namespace declarationImpact
This is unrelated to issue #1, but it blocks analyzer-enabled test and build runs. Local validation for parser work had to use
-p:RunAnalyzers=falseto avoid these pre-existing failures.Suggested follow-up
SA1200NzbDrone.Commonfiles to the expected namespace/using layout