swiftlint: clear line length, attributes, extension modifiers, indentation (351 → 40) #20

Merged
founder merged 1 commit from swiftlint-mechanical-fixes into main 2026-07-26 22:22:30 +00:00
Owner

Empties the four rules you asked to keep enforcing, taking first-party violations 351 → 40.

rule before after
line_length 47 0
attributes 37 0
no_extension_access_modifier 33 0
indentation_width 31 0

type_contents_order (100) dropped from only_rules with its now-inert config block. Line length was already 120 — nothing to bump; the 47 were genuinely over (median 132, max 190).

Two things needed care, not a corrector

Extension access. private extension Foo { func bar() } ≠ extension Foo { private func bar() } — the first gives members file-wide reach for same-file callers, the second scopes them to the extension. Members lifted out of a private extension are therefore fileprivate (never narrower than before); public extension members are restated public so the API surface is unchanged. swiftc -parse cannot catch this — it's a visibility error, not syntax — so Build: Apple is the real check here.

Multiline strings. Indentation inside a string literal is content. The SQL in KeyStoreAgentLiveStore would have been rewritten by the rule, so include_multiline_strings: false rather than reflowing query text.

How lines were wrapped

Call argument lists split on top-level commas (quote/bracket-aware), @convention(c) signatures split across parameters, conformance lists one per line, one nested tuple extracted to a typealias, and two prose strings converted to multiline literals with \ continuations so the string stays byte-identical.

Verified: swiftc -parse clean on 38/38 modified files, lint re-run after each stage, no rule regressed.

Remaining 40 left alone: legacy_objc_type (13), anonymous_argument_in_multiline_closure (13), unavailable_function (6), async_without_await (5).

🤖 Generated with Claude Code

Empties the four rules you asked to keep enforcing, taking first-party violations **351 → 40**. | rule | before | after | |---|---|---| | `line_length` | 47 | **0** | | `attributes` | 37 | **0** | | `no_extension_access_modifier` | 33 | **0** | | `indentation_width` | 31 | **0** | `type_contents_order` (100) dropped from `only_rules` with its now-inert config block. **Line length was already 120** — nothing to bump; the 47 were genuinely over (median 132, max 190). ### Two things needed care, not a corrector **Extension access.** `private extension Foo { func bar() }` ≠ `extension Foo { private func bar() }` — the first gives members file-wide reach for same-file callers, the second scopes them to the extension. Members lifted out of a `private extension` are therefore **`fileprivate`** (never narrower than before); `public extension` members are restated `public` so the API surface is unchanged. `swiftc -parse` cannot catch this — it's a visibility error, not syntax — so **Build: Apple is the real check here**. **Multiline strings.** Indentation inside a string literal is content. The SQL in `KeyStoreAgentLiveStore` would have been rewritten by the rule, so `include_multiline_strings: false` rather than reflowing query text. ### How lines were wrapped Call argument lists split on top-level commas (quote/bracket-aware), `@convention(c)` signatures split across parameters, conformance lists one per line, one nested tuple extracted to a `typealias`, and two prose strings converted to multiline literals with `\` continuations so the string stays byte-identical. Verified: `swiftc -parse` clean on **38/38** modified files, lint re-run after each stage, **no rule regressed**. Remaining 40 left alone: `legacy_objc_type` (13), `anonymous_argument_in_multiline_closure` (13), `unavailable_function` (6), `async_without_await` (5). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
swiftlint: clear line length, attributes, extension modifiers, indentation
Some checks failed
Build: SQLite SEE / Redacted SEE compile (pull_request) Successful in 6s
Release: If Needed / Check (Release Needed) (push) Successful in 6s
Build: Apple / Check (SwiftLint) (pull_request) Failing after 21s
Build: Apple / Build (visionOS) (pull_request) Has been skipped
Build: Apple / Build (iOS) (pull_request) Has been skipped
Build: Apple / Build (macOS) (pull_request) Has been skipped
Build: Apple / Check (SwiftLint) (push) Failing after 22s
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 29s
Deploy: API / Deploy (API) (push) Successful in 3m18s
Deploy: Web / Deploy (Web) (push) Successful in 6m7s
Build: KaiOS / Build (KaiOS) (push) Has been cancelled
Build: Web / Build (Web) (push) Has been cancelled
Build: Linux / Build (Linux x86_64) (pull_request) Failing after 15m25s
Build: Linux / Build (keystore-forge x86_64) (pull_request) Has been skipped
Build: KaiOS / Build (KaiOS) (pull_request) Successful in 9m22s
Build: Linux / Build (Linux x86_64) (push) Failing after 14m18s
Build: Linux / Build (keystore-forge x86_64) (push) Has been skipped
Build: Web / Build (Web) (pull_request) Successful in 19m10s
c60c096192
Takes the first-party violation count from 351 to 40 and empties the four rules
you asked to keep enforcing.

  line_length                   47 -> 0
  attributes                    37 -> 0
  no_extension_access_modifier  33 -> 0
  indentation_width             31 -> 0

`type_contents_order` (100) is dropped from `only_rules`, along with its now-inert
configuration block. Line length was already 120, so nothing needed bumping --
the 47 violations were genuinely over it (median 132, max 190).

Two things needed care rather than a corrector:

`private extension Foo { func bar() }` is not the same as
`extension Foo { private func bar() }`. The first gives members file-wide reach
for same-file callers; the second scopes them to the extension. Members lifted
out of a `private extension` are therefore `fileprivate`, which is never
narrower than what they had. `public extension` members are restated `public` so
the API surface is unchanged. `swiftc -parse` cannot catch this class of
mistake -- it is a visibility error, not a syntax one -- so CI's Build: Apple
job is the real check.

Indentation inside a multiline string literal is content, not code: the SQL laid
out for readability in KeyStoreAgentLiveStore would have been rewritten by the
rule. Configured `include_multiline_strings: false` instead of reflowing the
query text.

Long lines were wrapped structurally -- call argument lists split on top-level
commas (quote- and bracket-aware), `@convention(c)` C function-pointer
signatures split across parameters, conformance lists one per line, and one
nested tuple type extracted to a `typealias`. Two long prose strings became
multiline literals with `\` continuations so the resulting string is byte-identical.

Every modified file checked with `swiftc -parse` (38/38 clean) and the lint
re-run after each stage to confirm no rule regressed.

Remaining 40 are a different shape and left alone: legacy_objc_type (13),
anonymous_argument_in_multiline_closure (13), unavailable_function (6),
async_without_await (5).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign in to join this conversation.
No labels
No milestone
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!20
No description provided.