Lint policy pass: tune .swiftlint.yml to the codebase #194

Closed
opened 2026-11-17 13:39:44 +01:00 by AlexKucera · 1 comment
Owner

What to build

swiftlint . stops flagging deliberate style. The repo carries 279 findings; most are style-policy noise, not defects. Decide the per-rule posture in .swiftlint.yml with a one-line rationale comment per disable (classis precedent — its config carries the same comment shape):

  • Disable: identifier_name (short closure params/locals like tv/ns/lo/hi — not a signal), inclusive_language (the master/masterRoot profile-root vocabulary is deliberate domain naming — user decision 2026-11-17, rename rejected), file_length and type_body_length (deliberately large cohesive units), nesting (idiomatic nested CodingKeys/enums), optional_data_string_conversion (intentional lossy String(decoding:) for process/file output)
  • Keep enabled and fixable: line_length, opening_brace, cyclomatic_complexity, for_where, orphaned_doc_comment, function_body_length, function_parameter_count, legacy_constructor, force_try
  • Exclude spike/ from linting entirely (throwaway SPM experiments, not built into any target — 129 findings, 59 of the 60 errors, die with the exclude)

Acceptance criteria

  • Every disabled rule carries a one-line rationale comment in .swiftlint.yml
  • spike/ excluded; swiftlint no longer reports anything under it
  • Surviving inventory enumerated in a comment on this issue (expected ≈ 1 error, ~48 warnings: 21 line_length, 13 opening_brace, 5 cyclomatic_complexity, 4 for_where, 3 function_body_length, 1 orphaned_doc_comment, 1 function_parameter_count)
  • swiftformat clean; full unit suite green via ./scripts/full-test.sh (config change only — no Swift edits)

Blocked by

None (can start immediately).

[Generated by AI]

## What to build `swiftlint .` stops flagging deliberate style. The repo carries 279 findings; most are style-policy noise, not defects. Decide the per-rule posture in `.swiftlint.yml` with a one-line rationale comment per disable (classis precedent — its config carries the same comment shape): - Disable: `identifier_name` (short closure params/locals like tv/ns/lo/hi — not a signal), `inclusive_language` (the `master`/`masterRoot` profile-root vocabulary is deliberate domain naming — user decision 2026-11-17, rename rejected), `file_length` and `type_body_length` (deliberately large cohesive units), `nesting` (idiomatic nested CodingKeys/enums), `optional_data_string_conversion` (intentional lossy String(decoding:) for process/file output) - Keep enabled and fixable: line_length, opening_brace, cyclomatic_complexity, for_where, orphaned_doc_comment, function_body_length, function_parameter_count, legacy_constructor, force_try - Exclude `spike/` from linting entirely (throwaway SPM experiments, not built into any target — 129 findings, 59 of the 60 errors, die with the exclude) ## Acceptance criteria - [ ] Every disabled rule carries a one-line rationale comment in `.swiftlint.yml` - [ ] `spike/` excluded; swiftlint no longer reports anything under it - [ ] Surviving inventory enumerated in a comment on this issue (expected ≈ 1 error, ~48 warnings: 21 line_length, 13 opening_brace, 5 cyclomatic_complexity, 4 for_where, 3 function_body_length, 1 orphaned_doc_comment, 1 function_parameter_count) - [ ] swiftformat clean; full unit suite green via `./scripts/full-test.sh` (config change only — no Swift edits) ## Blocked by None (can start immediately). [Generated by AI]
AlexKucera added the ready-for-agent label 2026-11-17 13:39:44 +01:00
AlexKucera added a new dependency 2026-11-17 13:40:37 +01:00
AlexKucera added a new dependency 2026-11-17 13:40:37 +01:00
Author
Owner

Lint policy pass landed in .swiftlint.yml (config + AGENTS.md learning refresh only — no Swift edits).

Disabled, each with a one-line rationale comment in the config: identifier_name, inclusive_language, file_length, type_body_length, nesting, optional_data_string_conversion (plus the pre-existing trailing_comma).

spike/ excluded — swiftlint reports nothing under it (was 129 findings, 59 of the 60 baseline errors).

Surviving inventory (actual, SwiftLint 0.65.1): 0 errors, 33 warnings

Count Rule
12 line_length
9 opening_brace
5 cyclomatic_complexity
3 function_body_length
1 orphaned_doc_comment
1 function_parameter_count
1 legacy_constructor
1 for_where

vs the ticket's estimate (~48 warnings, 1 error): the expected error was the identifier_name error in MuseionTests — disabled by this policy, so 0 errors survive. The line_length / opening_brace / for_where estimates ran high (12 / 9 / 1 actual); all 12 line_length survivors exceed even the default 120-char threshold, so it's not a threshold artifact — the estimate was simply conservative. legacy_constructor (kept enabled per the ticket) adds 1 warning the estimate omitted.

Verification: swiftlint . exits clean (warnings only), swiftformat --lint . → 0/141 files require formatting, full unit suite via ./scripts/full-test.sh → 692 executed / 692 passed / 0 failed.

[Generated by AI]

Lint policy pass landed in `.swiftlint.yml` (config + AGENTS.md learning refresh only — no Swift edits). **Disabled, each with a one-line rationale comment in the config:** `identifier_name`, `inclusive_language`, `file_length`, `type_body_length`, `nesting`, `optional_data_string_conversion` (plus the pre-existing `trailing_comma`). **`spike/` excluded** — swiftlint reports nothing under it (was 129 findings, 59 of the 60 baseline errors). **Surviving inventory (actual, SwiftLint 0.65.1): 0 errors, 33 warnings** | Count | Rule | | --- | --- | | 12 | line_length | | 9 | opening_brace | | 5 | cyclomatic_complexity | | 3 | function_body_length | | 1 | orphaned_doc_comment | | 1 | function_parameter_count | | 1 | legacy_constructor | | 1 | for_where | vs the ticket's estimate (~48 warnings, 1 error): the expected error was the `identifier_name` error in MuseionTests — disabled by this policy, so 0 errors survive. The line_length / opening_brace / for_where estimates ran high (12 / 9 / 1 actual); all 12 line_length survivors exceed even the default 120-char threshold, so it's not a threshold artifact — the estimate was simply conservative. `legacy_constructor` (kept enabled per the ticket) adds 1 warning the estimate omitted. **Verification:** `swiftlint .` exits clean (warnings only), `swiftformat --lint .` → 0/141 files require formatting, full unit suite via `./scripts/full-test.sh` → 692 executed / 692 passed / 0 failed. [Generated by AI]
Sign in to join this conversation.