Skip to content

StyleCop SA1200 failures in NzbDrone.Common block analyzer-enabled builds #62

Description

@Starosdev

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions