Skip to content

Refactor to re-enable disabled SwiftLint rules #212

@bguidolim

Description

@bguidolim

Context

SwiftLint was introduced in the project (PR pending). Several structural rules were disabled because the existing codebase has violations that require significant refactoring to fix. These should be re-enabled incrementally.

Disabled rules to re-enable

cyclomatic_complexity (25 violations when last checked)

Functions in Configurator.swift, CLIOutput.swift, GlobalSyncStrategy.swift, and others have complexity 11-31 (default threshold: 10). Requires breaking complex functions into smaller, focused methods.

type_body_length (24 violations when last checked)

Structs in both Sources (11) and Tests (13) exceed 250-line bodies. Sources violations concentrated in Configurator, CLIOutput, ExternalPackManifest. Test structs naturally grow large — consider splitting test files or adjusting thresholds for tests.

file_length (22 violations when last checked)

Files exceeding 400 lines. Directly correlated with type_body_length — fixing one will largely fix the other.

Approach

  1. Address cyclomatic_complexity first — it's the most impactful for code quality
  2. type_body_length and file_length will improve as complex functions are extracted
  3. Consider different thresholds for test files vs source files
  4. Re-enable each rule in .swiftlint.yml as violations are cleared

References

  • .swiftlint.yml — rules marked with # TODO: Re-enable after refactoring

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