Repository navigation
Land architecture rules, CI, performance doc, site and README (supersedes #8–#11) - #12
Merged
Merged
Conversation
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.
The library compiles to nothing on the host, where package-benchmark runs. Measured on an iPhone simulator instead: the library adds about 16 us to a 100 us render of eight variations, so there is no hot path to improve.
The usage snippet wrote .dynamicTypeSize(.xSmall), which does not compile because the payload is Any. Install from 1.1.4, link the site and docs, list the supported values and the cases that are no-ops.
Xcode 16 enforces the iOS 14 deployment target, where DynamicTypeSize is unavailable.
…tDescendant sources-are-simulator-only now reads scope.topLevelStatements(notUnder: "targetEnvironment(simulator)") instead of a local copy, and the description detector uses the library's firstDescendant(of:). The two DetectorTests that only tested the removed guard detector go with it. public-types-declare-availability uses Declaration.isPublic, so an open type counts too. availabilityOffTheFloor keeps reading every @available attribute rather than Declaration.attributes, which would miss declarations Declaration does not model, such as subscripts.
This was referenced Nov 14, 2026
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.
Lands the stacked #8, #9, #10 and #11 in one pull request, so
mainneeds a single review.docs/readme-and-metadataheld all four and merged intomainwithout conflicts. This PR supersedes those four; they will be closed, and their branches kept.What each superseded PR contained
chore/architecture-rules)Architecture/: a test-only swift-llm-check package with seven rules, written down inCODING_STANDARDS.md: simulator-only sources, an import budget,@availableon the package floor, public types declare availability,AnyViewonly inapply(to:), erasedAnypayloads name their type, and captions name their case.docs/architecture-rules.mdis generated from the rules.Locale+Identifier.swiftsat outside the simulator guard, andLegibilityWeightdeclared@available(iOS 13.0, *).xcodebuild teston an iOS simulator, tvOS/watchOS/visionOS simulator builds, and actionlint and zizmor on the workflows.AGENTS.mdandCLAUDE.md.docs/performance):docs/performance.mdexplains why there is no benchmark package (the module is empty on the host) and gives p50 timings measured on a simulator. The library adds about 16 µs to a SwiftUI render of about 100 µs. No library change.docs/github-pages):site/index.htmland.github/workflows/pages.yml.ReadmeTestscompiles the site's code samples against the public API.docs/readme-and-metadata): a rewritten README with the CI badge and links to the site and docs, and an install snippet for1.1.4. It fixes the.dynamicTypeSize(.xSmall)snippet, which did not compile, to.dynamicTypeSize(DynamicTypeSize.xSmall), and lists the supported values and the no-op cases.New in this PR: swift-llm-check 0.5.0
Architecture/Package.swiftnow requiresfrom: "0.5.0".sources-are-simulator-onlyuses the built-inscope.topLevelStatements(notUnder: "targetEnvironment(simulator)"). The localcodeOutsideSimulatorGuardandisSimulatorGuardare deleted, along with the two detector tests that only covered them.firstDescendant(of:)is deleted in favour of the library's.public-types-declare-availabilityusesDeclaration.isPublic, soopendeclarations count too.availability-names-the-package-floorstill reads every@availableattribute rather thanDeclaration.attributes("available"), which would miss declarations thatDeclarationdoes not model, such as subscripts.docs/architecture-rules.mdis unchanged.The library sources are not touched beyond what #8 already contained, so no release is needed.
Verified locally
swift build --build-testsandswift teston the host.swift test --package-path Architecture: 14 tests pass.xcodebuild test -scheme EnvironmentVariationPreviewon an iPhone simulator: 8 tests pass.