Repository navigation
chore(tooling): add swiftformat lint to lefthook with relaxed baseline config (option b) - #149
Merged
Merged
Conversation
Author a .swiftformat config that matches the existing codebase style (option b — disable 18+14 rules currently violated en-masse, --ifdef no-indent for column-1 #if convention) so all 244 source files pass swiftformat --lint without mass-format churn (~3,624 LOC avoided). Add swiftformat --lint to lefthook.yml pre-commit (report-only, after swiftlint, sequential per parallel:false RCA H4). Future commits drift into the baseline-relaxed style or fail locally. Re-evaluation trigger and per-rule violation counts documented in docs/foundations.md §7.5.1 and meetings/2026-05-26_swiftformat-option-b.impl-notes.md.
- N1: tighten --ifdef no-indent comment in .swiftformat — reflect reality that the repo mixes top-level col-1 directives with body-indent inner directives (UMPConsentPresenter.swift has both forms). Prior comment was misleading. - N2: reconcile indent violation count between .swiftformat (669) and docs/foundations.md §7.5.1 (was 685). 669 matches the swiftformat --lint baseline output the implementer subagent captured. - N4: add lockstep note to docs/foundations.md §7.5.1 — bumping swift-tools-version in Package.swift requires bumping the --swiftversion 6.2 pin in .swiftformat. N3 (lint.yml flip to hard-fail after this merges) tracked in PR body as post-merge action, not in this commit. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Owner
Author
CR nits applied (commit
|
1 task
wei18
added a commit
that referenced
this pull request
May 26, 2026
…ollow-up) (#151) PR #149 landed `.swiftformat` option (b) relaxed-baseline config. 244/244 files now compliant with the pinned ruleset, so the advisory `continue-on-error: true` guard from PR #147 is no longer needed. Removes the guard + updates the inline comment to reference the new state + escape hatch for future broad-violations regressions. Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18
added a commit
that referenced
this pull request
May 26, 2026
…scriptions Inline-applied from CR review of PR #152: - pr-diff-verification: drop fabricated PR #126 narrative; replace with generic pattern description covering 3 recurring failure modes - monetization-sdk-integration: - fix FakeAdMobBridge path (Tests/AdsAdMobTests/, not MonetizationTesting/) - drop wrong PR #149 attribution (it's swiftformat, not the fatalError) - clarify Sources/MonetizationTesting/ scaffolding vs test-target fakes - tighten description for clearer auto-discovery trigger (CR B+ → A) - subagent-conflict-detection: §派發契約 §9 → "item 9" (methodology uses narrative numbering, not formal §N sub-headings) No content removed — only factual corrections + 1 description tighten. Co-Authored-By: Claude Opus 4.7 <[email protected]>
wei18
added a commit
that referenced
this pull request
May 26, 2026
…tem) (#152) * docs(skills): fill 4 repo-derived skills + foundations.md update (closes #11 5-of-5) Closes the "補齊 repo skills/context 缺口" backlog entry from 2026-05-24 reflection. All 5 sub-items now landed: (a) ✅ subagent-conflict-detection — pre-dispatch grep target file set vs in-flight subagent worktrees; prevents parallel-dispatch race (b) ✅ pr-diff-verification — pre-push `git show --stat HEAD` cross-check vs commit message claims; encodes PR #126 incident + worktree-wipe lost-commits + push-wrong-ref footguns (c) ✅ asc-ops-handoff — User-owned vs Leader-orderable vs hybrid taxonomy for App Store Connect / TestFlight / Apple Developer ops; references canonical docs (v2.5-readiness.md, ASCRegister, etc.) (d) ✅ monetization-sdk-integration — foundations §9 break-glass exception process + isolation contract (single-file protocol seam, canImport gating, audit grep regex); encodes AdMob v13 upgrade + Production ID swap safety + macOS conditional gating incidents (e) ✅ memory subdir reorg — already in place since 2026-05-25 (user/feedback/project/reference dirs) All 4 new skills live at `.claude/skills/<name>/SKILL.md` per [[feedback-project-derived-skills-location]] (project-derived skills are repo-level, not $HOME). foundations.md §Backlog entry updated with ✅ marks + linked file refs. Co-Authored-By: Claude Opus 4.7 <[email protected]> * docs(skills): apply CR #152 nits — fix factual citations + tighten descriptions Inline-applied from CR review of PR #152: - pr-diff-verification: drop fabricated PR #126 narrative; replace with generic pattern description covering 3 recurring failure modes - monetization-sdk-integration: - fix FakeAdMobBridge path (Tests/AdsAdMobTests/, not MonetizationTesting/) - drop wrong PR #149 attribution (it's swiftformat, not the fatalError) - clarify Sources/MonetizationTesting/ scaffolding vs test-target fakes - tighten description for clearer auto-discovery trigger (CR B+ → A) - subagent-conflict-detection: §派發契約 §9 → "item 9" (methodology uses narrative numbering, not formal §N sub-headings) No content removed — only factual corrections + 1 description tighten. Co-Authored-By: Claude Opus 4.7 <[email protected]> --------- Co-authored-by: Claude Opus 4.7 <[email protected]>
16 of 22 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
User decision 2026-05-26: option (b) for swiftformat — write `.swiftformat` config that relaxes rules to match current code style, rather than (a) mass-format 204 files / (b) defer entirely.
Goal: baseline passes without touching any source; swiftformat catches NEW drift; future trigger to revisit option (a) when style review nits accumulate.
Changes
.swiftformat— 32 rules disabled to match baseline:lefthook.yml— append swiftformat command after swiftlint (sequential per fix(lefthook): serialize pre-commit to break RCA H4 mise deadlock #136)docs/foundations.md §7.5.1— document option (b) choice + re-evaluation trigger4 files, +171 LOC. Zero source .swift files touched.
Baseline analysis — top 5 violated rules (default config)
`--ifdef no-indent` alone resolves 653/669 indent violations (matches the `#if/#else` column-1 convention this repo uses).
Validation
Cross-PR coordination
PR #147 (GH Actions Phase 1) ships `lint.yml` with SwiftFormat step as `continue-on-error: true` pending this baseline. After this merges, flip `continue-on-error: false` in a follow-up commit so CI hard-fails on drift.
Closes
Test plan
🤖 Generated with Claude Code