swiftlint: clear the mechanically-correctable violations (351 → 288) #19
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
key-store/key.store!19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "swiftlint-mechanical-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 pushesindentation_widthfrom 31 to 63.The
trailing_closurecorrector mangles its output, emitting) { query inwith 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 withswiftc -parseon each edited file; re-lint shows no rule regressed.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
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>