Skip to content

Speed up dev-lint by avoiding SwiftLint script-input mode for full-repo lint #426

Description

@baron

Impact

make dev-lint currently spends most of its time in the SwiftLint phase when running full-repo style validation. The SwiftFormat phase is comparatively small; SwiftLint dominates the coordinated lint wall time.

Evidence

Environment:

  • Repo commit: 84eb163f
  • macOS: 26.5.2
  • Architecture: arm64
  • SwiftLint: 0.63.3

Observed timings on the same checkout:

  • make dev-lint: 118.41s total
    • SwiftFormat phase: 7.03s
    • SwiftLint phase dominated the remaining time
    • SwiftLint command shape: swiftlint lint --strict --config .swiftlint.yml --use-script-input-files

Direct SwiftLint comparisons:

  • Config-discovered full-repo lint:

    • swiftlint lint --strict --config .swiftlint.yml --quiet
    • 4.15s to 5.16s
  • Current script-input shape over the same scoped file list:

    • swiftlint lint --strict --config .swiftlint.yml --use-script-input-files --quiet
    • 14.56s to 26.78s
  • Current script-input shape without --quiet:

    • 18.67s
  • Config-discovered lint without cache:

    • swiftlint lint --strict --config .swiftlint.yml --quiet --no-cache
    • 50.88s

This suggests the full-repo lint path is paying a large penalty for feeding SwiftLint 1,427 individual SCRIPT_INPUT_FILE_* entries, and may also interact poorly with SwiftLint cache behavior and conductor log volume.

Recommendation

For full-repo lint in Scripts/swift_style.sh, prefer the config-discovered SwiftLint path:

swiftlint lint --strict --config "$ROOT_DIR/.swiftlint.yml" --quiet

Optionally include --force-exclude for belt-and-suspenders exclusion behavior.

Before switching, make .swiftlint.yml fully mirror the wrapper's excluded file scope if exact parity matters, including the large workflow prompt files that Scripts/swift_style.sh currently excludes from the explicit file list.

Keep --use-script-input-files only for a future focused/changed-file lint mode where the file set is materially smaller than the full repo.

Acceptance Criteria

  • make dev-lint still validates the intended first-party Swift scope.
  • SwiftLint does not lint generated, vendored, build, or transient directories.
  • Full-repo SwiftLint wall time is closer to config-discovered timings than the current script-input timings.
  • Conductor lint output remains bounded and useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions