PostsModel.swift back under the lint ceilings: extensions split + class-body move #146

Closed
opened 2026-11-03 11:36:05 +01:00 by AlexKucera · 0 comments
Owner

What to build

PostsModel.swift passes swiftlint clean again — both length errors and its two brace warnings gone — with zero behavior change. The file sits at 1127 lines against the 1000 ceiling and the PostsModel class body spans 361 against 350; both violations pre-date this week (#143 deepened them by +8 and named this split as the follow-up).

The move, following the house pattern (#33 moved micropubSendDraft into Micropub.swift at this same ceiling; #111 moved guard members to a file-scope extension for the same type-body reason):

  • The six domain extensions after the class — mixed-content outline guard (#111), Convert to Post (#114), pass orchestration (#24), Blind Read (#122), stored fix cards + apply/skip/done + promote (#23/#25/#26), with their support types (PendingConversion, FixCardApplyOutcome, FixCardPromoteOutcome) — move to their own file(s), domain-grouped at the implementer's discretion. PostsModel.swift lands around 700 lines.
  • The watcher section (startWatching + rescan) moves to a file-scope extension so the class body drops under 350. Members that were private widen to internal where the move crosses files — the only visibility change allowed.
  • The two wrapped-condition guards (the opening_brace warnings) unwrap per the #142 learning: nested ifs or a hoisted helper, never the wrap.

Pure moves: no signature, semantic, or naming edits beyond that visibility widening; filesystem-synchronized groups mean Xcode follows the disk.

Acceptance criteria

  • swiftlint lint reports ZERO violations (errors AND warnings) on every touched file
  • swiftformat . clean
  • Build green; full MuseionTests suite green by xcresult executed count (573 at filing)
  • No public-API change (members keep their names and module visibility; the only allowed widening is private→internal for moved members)
  • DOX pass: Museion/AGENTS.md's PostsModel entry updated wherever it says an extension lives in this file (the "same-file extension" mentions)

Blocked by

None (can start immediately).

[Generated by AI]

## What to build `PostsModel.swift` passes `swiftlint` clean again — both length errors and its two brace warnings gone — with zero behavior change. The file sits at 1127 lines against the 1000 ceiling and the `PostsModel` class body spans 361 against 350; both violations pre-date this week (#143 deepened them by +8 and named this split as the follow-up). The move, following the house pattern (#33 moved `micropubSendDraft` into Micropub.swift at this same ceiling; #111 moved guard members to a file-scope extension for the same type-body reason): - The six domain extensions after the class — mixed-content outline guard (#111), Convert to Post (#114), pass orchestration (#24), Blind Read (#122), stored fix cards + apply/skip/done + promote (#23/#25/#26), with their support types (`PendingConversion`, `FixCardApplyOutcome`, `FixCardPromoteOutcome`) — move to their own file(s), domain-grouped at the implementer's discretion. PostsModel.swift lands around 700 lines. - The watcher section (`startWatching` + `rescan`) moves to a file-scope extension so the class body drops under 350. Members that were `private` widen to `internal` where the move crosses files — the only visibility change allowed. - The two wrapped-condition guards (the `opening_brace` warnings) unwrap per the #142 learning: nested ifs or a hoisted helper, never the wrap. Pure moves: no signature, semantic, or naming edits beyond that visibility widening; filesystem-synchronized groups mean Xcode follows the disk. ## Acceptance criteria - [ ] `swiftlint lint` reports ZERO violations (errors AND warnings) on every touched file - [ ] `swiftformat .` clean - [ ] Build green; full MuseionTests suite green by xcresult executed count (573 at filing) - [ ] No public-API change (members keep their names and module visibility; the only allowed widening is private→internal for moved members) - [ ] DOX pass: Museion/AGENTS.md's PostsModel entry updated wherever it says an extension lives in this file (the "same-file extension" mentions) ## Blocked by None (can start immediately). [Generated by AI]
AlexKucera added the ready-for-agent label 2026-11-03 11:36:05 +01:00
Sign in to join this conversation.