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.
1.8 KiB
1.8 KiB
Verification
Final checklist before considering an ExtremePackaging change done.
When applying these rules, always:
- Check current package structure matches documented 20-package layout
- Foundation: SharedModels, AppColors, AppFont
- Design System: AppTheme
- Verify new packages follow naming conventions
- Ensure dependencies flow unidirectionally (Foundation → Infrastructure → Features → Apps)
- Create test targets for all new packages
- Update Package.swift using closure-with-local-variables pattern:
- Define
deps,allProducts, andtargetsusinglet 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)
- Define
- Run
swift buildto verify package integrity - 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)
- Check platform separation in
Package.swiftuses#if os(), not#if canImport(). (Inside Swift source files,#if canImport(UIKit)/#if canImport(AppKit)is the correct idiom; the manifest is the only placecanImportis forbidden.) - Verify
.when(platforms:)used for platform-specific dependencies within targets - For font/resource packages:
- Confirm
.process()used for resources (NOT.copy()) - Verify
Bundle.moduleused (NOTBundle.main) - Check CoreText registration implemented with error handling
- Ensure registration called in app init before UI renders
- Verify no Info.plist font registration used
- Confirm