What problem does it solve?
Agent-written Swift code grows long and branchy quickly, and hand-reviewing every function for length or complexity does not scale. This Skill sets deterministic SwiftLint thresholds for cyclomatic complexity, function/type/file length, and parameter count, and adopts them via a violations baseline so existing code never blocks the gate.
Core Features & Use Cases
- Threshold Configuration: Provides a ready-to-merge
.swiftlint.yml fragment setting warning/error limits for five built-in rules: cyclomatic_complexity (10/20), function_body_length (50/100), type_body_length (300/500), file_length (500/1000), and function_parameter_count (5/8).
- Brownfield Baseline Adoption: Freezes existing violations with
swiftlint lint --write-baseline and gates only new violations via --strict --baseline, avoiding mass-refactoring of working code.
- Structural Fix Guidance: Maps each fired rule to a structural remedy (extract functions, split types by responsibility, introduce parameter structs) instead of inline
swiftlint:disable suppressions.
- Use Case: A team whose AI agents generate most of the Swift code merges the fragment into
.swiftlint.yml, records a baseline, and adds the strict baseline check to CI so no new over-complex function can merge.
Quick Start
Ask the AI to merge the code-size SwiftLint fragment into the project's .swiftlint.yml, generate a violations baseline, and add a strict baseline lint gate to CI.