Swift profile and checker fixes found adopting kof22-post #38

Open
opened 2026-10-12 12:53:31 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-10-12 12:53:31 +00:00 (Migrated from github.com)

Found while adopting the standards v1.0.0 in kof22-post (Swift 6.4, Xcode 27). Each item is worked around locally in that repository and recorded in its docs/standards-conformance.md.

  1. configs/swift/.swiftlint.yml: analyzer rules. unused_declaration and unused_import are listed under opt_in_rules, but they only run under swiftlint analyze; SwiftLint 0.65 warns on every run. Move them to analyzer_rules.
  2. configs/swift/.swiftlint.yml vs .swift-format: else placement. .swift-format sets lineBreakBeforeControlFlowKeywords: true (else/catch on a new line, K22-CODE-SW-01), while SwiftLint's default statement_position requires } else {, so the two configs contradict each other. Add statement_position: { statement_mode: uncuddled_else }.
  3. Checker, K22-REPO-42. The rule covers Product repositories, but Test-RepoConformance.ps1 reports FAIL for a repository whose README declares the Internal tier. It already lowers K22-REPO-12 for Internal; K22-REPO-42 should be N/A there.
  4. security.yml vs K22-REPO-32. The shared security workflow uses docker:// container steps (gitleaks, Trivy). With a selected-actions policy (github_owned_allowed plus patterns for KofTwentyTwo/standards/*), calling it fails at startup. Either document the pattern that admits these steps, or accept "all actions + require SHA pinning" as the compliant setting (the standards repository itself uses all).
  5. Generator note (FYI, not a standards bug). swift-openapi-generator 1.14.0 drops components/examples when filtering operations and then fails on parameter examples that reference them; kof22-post strips those examples from the generator input (scripts/prepare-spec.sh).

AI-assisted (Claude Opus 5.5).

Found while adopting the standards v1.0.0 in [kof22-post](https://github.com/KofTwentyTwo/kof22-post) (Swift 6.4, Xcode 27). Each item is worked around locally in that repository and recorded in its `docs/standards-conformance.md`. 1. **`configs/swift/.swiftlint.yml`: analyzer rules.** `unused_declaration` and `unused_import` are listed under `opt_in_rules`, but they only run under `swiftlint analyze`; SwiftLint 0.65 warns on every run. Move them to `analyzer_rules`. 2. **`configs/swift/.swiftlint.yml` vs `.swift-format`: `else` placement.** `.swift-format` sets `lineBreakBeforeControlFlowKeywords: true` (else/catch on a new line, K22-CODE-SW-01), while SwiftLint's default `statement_position` requires `} else {`, so the two configs contradict each other. Add `statement_position: { statement_mode: uncuddled_else }`. 3. **Checker, `K22-REPO-42`.** The rule covers Product repositories, but `Test-RepoConformance.ps1` reports FAIL for a repository whose README declares the Internal tier. It already lowers `K22-REPO-12` for Internal; `K22-REPO-42` should be N/A there. 4. **`security.yml` vs `K22-REPO-32`.** The shared security workflow uses `docker://` container steps (gitleaks, Trivy). With a selected-actions policy (`github_owned_allowed` plus patterns for `KofTwentyTwo/standards/*`), calling it fails at startup. Either document the pattern that admits these steps, or accept "all actions + require SHA pinning" as the compliant setting (the standards repository itself uses `all`). 5. **Generator note (FYI, not a standards bug).** swift-openapi-generator 1.14.0 drops `components/examples` when filtering operations and then fails on parameter `examples` that reference them; kof22-post strips those examples from the generator input (`scripts/prepare-spec.sh`). AI-assisted (Claude Opus 5.5).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/standards#38