Skip to content

Add architecture rules (swift-llm-check), simulator tests and CI - #8

Closed
mackoj wants to merge 5 commits into
mainfrom
chore/architecture-rules
Closed

mackoj wants to merge 5 commits into
mainfrom
chore/architecture-rules

Conversation

@mackoj

@mackoj mackoj commented Nov 14, 2026

Copy link
Copy Markdown
Owner

What

  • Architecture/: a test-only package (swift-tools 6.0, macOS) on swift-llm-check with seven rules taken from the code's existing conventions, now written down in CODING_STANDARDS.md:

    • sources-are-simulator-only: every file in Sources is wrapped, whole, in #if targetEnvironment(simulator)
    • imports-stay-within-budget: Foundation, SwiftUI, CoreData only
    • availability-names-the-package-floor and public-types-declare-availability
    • any-view-stays-in-apply: AnyView only in EnvironmentValueItem.apply(to:)
    • erased-payloads-name-their-type: case dynamicTypeSize(Any) // DynamicTypeSize
    • descriptions-name-their-case: the caption for .name(…) starts with "name: "

    Each has detector tests on snippets; docs/architecture-rules.md is generated from them.

  • Two real violations fixed: Locale+Identifier.swift was the only file outside the simulator guard (a 950-case enum compiled into device builds), and LegibilityWeight's conformance said @available(iOS 13.0, *).

  • Tests: the test target was an empty placeholder. It now has five XCTest cases (simulator-only, like the library).

  • CI (there was none): macOS host build + swift test + architecture rules; xcodebuild test on an iOS simulator; builds for tvOS, watchOS and visionOS simulators; actionlint and zizmor on the workflows.

  • AGENTS.md / CLAUDE.md for agents.

The library's swift-tools-version: 5.7.1 and platforms are unchanged.

Locale+Identifier.swift was the one file outside #if targetEnvironment(simulator),
so its 950-case enum compiled into device builds. LegibilityWeight's
CustomStringConvertible conformance named iOS 13 only.
Seven rules from CODING_STANDARDS.md: simulator-only sources, the import
budget, one availability floor, AnyView only in apply(to:), erased payloads
name their type, and captions name their case. Detector tests and the
generated docs/architecture-rules.md included.
@mackoj

mackoj commented Nov 14, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #12

@mackoj mackoj closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant