swiftlint: clear the mechanically-correctable violations (351 → 288) #19

Merged
founder merged 1 commit from swiftlint-mechanical-fixes into main 2026-07-26 21:54:05 +00:00
Owner

Clears the mechanically-correctable half of the 351 violations that became visible once vendored packages were excluded (#18).

Fully cleared: prefer_self_in_static_references (18), number_separator (11), return_value_from_void_function (9), sorted_imports (7), modifier_order (7), trailing_closure (7), vertical_whitespace_closing_braces (2), empty_count (1), comma_inheritance (1).

Scoped with --only-rule, not a blanket --fix — the blanket run touches 149 files, only moves 351→317, and pushes indentation_width from 31 to 63.

The trailing_closure corrector mangles its output, emitting ) { query in with the body left at the old depth — worse than the violation it fixes. Repaired 5 sites by hand (one of which SwiftLint didn't flag afterwards). Verified with swiftc -parse on each edited file; re-lint shows no rule regressed.

count
before 351
after 288

Left for follow-up (each needs judgement, not a rewrite): type_contents_order (100, member reordering), line_length (47), attributes (37), no_extension_access_modifier (33), indentation_width (32).

🤖 Generated with Claude Code

Clears the mechanically-correctable half of the 351 violations that became visible once vendored packages were excluded (#18). **Fully cleared:** `prefer_self_in_static_references` (18), `number_separator` (11), `return_value_from_void_function` (9), `sorted_imports` (7), `modifier_order` (7), `trailing_closure` (7), `vertical_whitespace_closing_braces` (2), `empty_count` (1), `comma_inheritance` (1). **Scoped with `--only-rule`, not a blanket `--fix`** — the blanket run touches 149 files, only moves 351→317, and pushes `indentation_width` from 31 to **63**. **The `trailing_closure` corrector mangles its output**, emitting `) { query in` with the body left at the old depth — worse than the violation it fixes. Repaired 5 sites by hand (one of which SwiftLint didn't flag afterwards). Verified with `swiftc -parse` on each edited file; re-lint shows **no rule regressed**. | | count | |---|---| | before | 351 | | after | **288** | **Left for follow-up** (each needs judgement, not a rewrite): `type_contents_order` (100, member reordering), `line_length` (47), `attributes` (37), `no_extension_access_modifier` (33), `indentation_width` (32). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
swiftlint: clear the mechanically-correctable violations (351 -> 288)
Some checks failed
Build: SQLite SEE / Redacted SEE compile (pull_request) Successful in 5s
Release: If Needed / Check (Release Needed) (push) Successful in 5s
Build: Apple / Check (SwiftLint) (push) Failing after 18s
Build: Apple / Build (iOS) (push) Has been skipped
Build: Apple / Build (macOS) (push) Has been skipped
Build: Apple / Build (visionOS) (push) Has been skipped
Build: SQLite SEE / Redacted SEE compile (push) Successful in 28s
Deploy: API / Deploy (API) (push) Successful in 3m3s
Build: Apple / Check (SwiftLint) (pull_request) Failing after 3m13s
Build: Apple / Build (iOS) (pull_request) Has been skipped
Build: Apple / Build (macOS) (pull_request) Has been skipped
Build: Apple / Build (visionOS) (pull_request) Has been skipped
Deploy: Web / Deploy (Web) (push) Has been cancelled
Build: Web / Build (Web) (pull_request) Has started running
Build: KaiOS / Build (KaiOS) (pull_request) Successful in 9m32s
Build: Web / Build (Web) (push) Has started running
Build: Linux / Build (Linux x86_64) (pull_request) Failing after 13m50s
Build: Linux / Build (keystore-forge x86_64) (pull_request) Has been skipped
Build: Linux / Build (Linux x86_64) (push) Failing after 1m11s
Build: Linux / Build (keystore-forge x86_64) (push) Has been skipped
Build: KaiOS / Build (KaiOS) (push) Successful in 8m40s
7b6bdfc4fd
With the vendored packages excluded, 351 real violations became visible in our
own code. This clears the ones a corrector can handle safely and leaves the ones
that need judgement.

Fully cleared: prefer_self_in_static_references (18), number_separator (11),
return_value_from_void_function (9), sorted_imports (7), modifier_order (7),
trailing_closure (7), vertical_whitespace_closing_braces (2), empty_count (1),
comma_inheritance (1).

Scoped the corrector with --only-rule rather than running a blanket --fix,
because the blanket run is actively harmful here: it touches 149 files, only
moves 351 -> 317, and pushes indentation_width from 31 to 63.

Even scoped, the trailing_closure corrector mangles its output -- it emits
`)            { query in` with the body left at the old depth, which is worse
than the violation it fixes. Repaired those five sites by hand
(DatabaseVirtualTables x2, SQLiteScalarFunctions, KeyStorePersistenceTests x3,
one of which SwiftLint did not even flag afterwards). Verified with
`swiftc -parse` on each edited file, and confirmed a clean re-lint: no rule
regressed.

Left for a follow-up, since each needs a human decision rather than a rewrite:
type_contents_order (100, member reordering), line_length (47),
attributes (37), no_extension_access_modifier (33), indentation_width (32).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
key-store/key.store!19
No description provided.