Normalize Swift toolchain and use raw identifiers for test names - #22
Merged
Conversation
Every target shares one `upcomingFeatures` array that turns on NonisolatedNonsendingByDefault, InferIsolatedConformances, ImmutableWeakCaptures, MemberImportVisibility, ExistentialAny, and InternalImportsByDefault, with `swiftLanguageModes: [.v5, .v6]` staying at the package level so existing consumers keep both modes. The tools-version stays at 6.3 for the same reason. InternalImportsByDefault makes SwiftMETAR export Foundation and NumberKit publicly for the Measurement, SortComparator, and Rational types in its API, and makes METARFormatting export Foundation and SwiftMETAR for its FormatStyle conformances. MemberImportVisibility needs explicit NumberKit imports in the fraction parser, the remark measurement extensions, and three specs; ExistentialAny spells out `any` on the Decoder, Encoder, Error, RemarkParser, and Subparser existentials. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EtA5RwfPWtcxu2NfAHfjAr
Every `@Test` function is a SE-0451 raw identifier spelling out the behavior it checks, so the test list reads as prose without a separate display-name string. Remark specs name themselves after the remark text they parse — `parses a PK WND 28045/15 remark` rather than `parsesAPKWND2804515Remark` — and the two WindChangeSpec cases now carry the names of the remarks their bodies actually exercise, which the old names had transposed. Suite types keep their existing names. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EtA5RwfPWtcxu2NfAHfjAr
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.
Toolchain settings
Package.swiftnow shares oneupcomingFeaturesarray across every target, addingImmutableWeakCaptures,MemberImportVisibility,ExistentialAny, andInternalImportsByDefaultto the two approachable-concurrency flags that were already there.swiftLanguageModes: [.v5, .v6]stays at the package level and the tools-version stays at6.3, so existing consumers are unaffected.InternalImportsByDefaultfallout:SwiftMETARpublicly exportsFoundation(forMeasurement,SortComparator,SortOrder,ComparisonResult) andNumberKit(forRatio/Rational) in the files whose public API uses those types.METARFormattingpublicly exportsFoundationandSwiftMETARfor itsFormatStyleconformances.MemberImportVisibilityneeded explicitimport NumberKitinNumericParsers.swift,Remark+Measurement.swift, and three specs that buildRatioliterals.ExistentialAnyfix-its spelled outanyonDecoder,Encoder,Swift.Error,RemarkParser, andPeriodParser.Subparser.CI is unchanged: the matrix already runs Swift 6.3 on macos-15, macos-26, and ubuntu-latest, so every leg has a 6.2+ compiler for the raw identifiers below.
Raw identifiers for test names
All 272
@Testfunctions are SE-0451 raw identifiers naming the behavior under test.@Test/@Suitestay on their own line, and suite types keep their existing names.Worth a look:
parses a PK WND 28045/15 remarkinstead ofparsesAPKWND2804515Remark— which makes them far easier to match against the METAR strings in the test body.WindChangeSpeccases carry the names of the remarks their bodies actually exercise. The old names had these transposed (parsesAWND14006KTAFT2701RemarkparsedWND VRB06KT AFT 2707); only the names moved, not the bodies.PeriodSpec's malformed-BECMG test name was trimmed to keep its declaration under the 100-column limit.Verification
swift buildandswift build --build-testsfrom clean: zero errors, zero warnings.swift test: 272 tests in 70 suites pass.swift format lint --strict -r .with the shared gist config: clean.swiftlint --strict: 0 violations in 249 files.swift package dump-package: clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01EtA5RwfPWtcxu2NfAHfjAr