PureYAML/docs/rules-swift/exp/verification.md
Mihaela M 5f3892f2c1 chore(rules): vendor the rules-swift canon into docs/rules-swift
Mirror the shared Swift rules canon (rules-swift, commit 4ebb892) into
docs/rules-swift/ as a read-only reference alongside the repo's tailored
docs/rules/. PROVENANCE.md records the source, commit, and what was
included or excluded; the upstream repo's own VCS, CI, and lint tooling
is omitted as machinery rather than rule content.

Exclude the vendored tree from the style gate (scripts/check-style.sh)
and the pre-commit hook: the canon's enforcement docs quote the
forbidden attribution phrases to define them, the same reason the
repo's own enforcement files are already excluded.
2026-06-26 05:36:12 +02:00

1.8 KiB

Verification

Final checklist before considering an ExtremePackaging change done.

When applying these rules, always:

  1. Check current package structure matches documented 20-package layout
    • Foundation: SharedModels, AppColors, AppFont
    • Design System: AppTheme
  2. Verify new packages follow naming conventions
  3. Ensure dependencies flow unidirectionally (Foundation → Infrastructure → Features → Apps)
  4. Create test targets for all new packages
  5. Update Package.swift using closure-with-local-variables pattern:
    • Define deps, allProducts, and targets using let variable: [Type] = { ... }() pattern
    • NEVER use inline array definitions
    • Use descriptive variable names for each dependency, product, and target
    • Group by purpose/layer with comment headers (// ---------- Header ----------)
    • Separate platform-specific code with #if os(iOS) || os(macOS)
  6. Run swift build to verify package integrity
  7. Verify Package.swift follows all formatting rules:
    • Trailing commas in arrays
    • Grouped dependencies (OpenAPI, Vapor, Apple-only)
    • Grouped products (base, appleOnly)
    • Grouped targets (modelTargets, apiTargets, uiTargets)
  8. Check platform separation in Package.swift uses #if os(), not #if canImport(). (Inside Swift source files, #if canImport(UIKit) / #if canImport(AppKit) is the correct idiom; the manifest is the only place canImport is forbidden.)
  9. Verify .when(platforms:) used for platform-specific dependencies within targets
  10. For font/resource packages:
    • Confirm .process() used for resources (NOT .copy())
    • Verify Bundle.module used (NOT Bundle.main)
    • Check CoreText registration implemented with error handling
    • Ensure registration called in app init before UI renders
    • Verify no Info.plist font registration used