Skip to content

feat: native swift profile (ships as 0.7.0) - #28

Merged
tizz98 merged 2 commits into
mainfrom
feat/swift-profile
Jul 17, 2026
Merged

feat: native swift profile (ships as 0.7.0)#28
tizz98 merged 2 commits into
mainfrom
feat/swift-profile

Conversation

@tizz98

@tizz98 tizz98 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Native Swift profile (ships as 0.7.0)

Adds a first-class swift profile so Swift/SwiftPM repos get proper defaults instead of falling back to generic.

What's new

  • ProfileKind::Swift across parse/name/for_kind + every exhaustive match (detect, scaffold, guards, signals).
  • src/profile/swift.rs: SwiftPM defaults — swift build / swift test, coverage via swift test --enable-code-coverage, .swift sources, language-agnostic signals with a Swift fragility pattern (try!/as!/fatalError(/.unsafelyUnwrapped), guards no-print-in-lib + deps-justified.
  • Detection: Package.swift → SwiftPM (Sources/* domains); *.xcodeproj/*.xcworkspace → Xcode-flavored with an xcodebuild note.
  • Runner-aware CI: generated ci.yml runs on macos-latest for swift (Xcode + Swift preinstalled — no toolchain step); every other profile stays on ubuntu-latest. meta-check/arch stay on Linux (grep-only).
  • deps-justified now understands SwiftPM: extracts .package(url:) dependency names from Package.swift.

Tests

Unit tests across profile/detect/scaffold/guards + a meta init --profile swift integration test asserting macos-latest CI. cargo fmt / clippy -D warnings / test and cargo run -- check --strict all green.

Bumps to 0.7.0 — merging to main triggers the release workflow (auto-tag v0.7.0 + publish binaries incl. aarch64-apple-darwin).

🤖 Generated with Claude Code

Adds a first-class `swift` profile alongside rust/typescript/python/generic.

- ProfileKind::Swift wired through parse/name/for_kind and every exhaustive
  match (detect, scaffold, guards, signals).
- src/profile/swift.rs: SwiftPM defaults (swift build/test, coverage via
  --enable-code-coverage), .swift sources, language-agnostic signals with a
  Swift fragility pattern (try!/as!/fatalError/unsafelyUnwrapped), and the
  no-print-in-lib + deps-justified guards.
- detect.rs: Package.swift -> SwiftPM (Sources/* domains); *.xcodeproj /
  *.xcworkspace -> Xcode-flavored with an xcodebuild note.
- CI is now runner-aware: generated ci.yml runs on macos-latest for swift
  (Xcode/Swift preinstalled, no toolchain step); other profiles stay on
  ubuntu-latest. meta-check/arch stay on Linux (grep-only).
- deps-justified understands SwiftPM: extracts .package(url:) names from
  Package.swift.
- Tests across profile/detect/scaffold/guards + a swift init integration test.

Bumps to 0.7.0 to ship the new profile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tizz98
tizz98 force-pushed the feat/swift-profile branch from 735cdce to 5f270b6 Compare July 17, 2026 23:33
Addresses adversarial review findings on the new swift profile:
- is_test_path now recognizes SwiftPM/XCTest conventions (capital-T `Tests/`
  dir, `<Name>Tests.swift`), so Swift test files are excluded from guards and
  arch signals — no more false no-print-in-lib failures under `check --strict`
  or bogus fragility tickets on `try!` in test setup.
- swift_deps skips whole-line `//` comments so a commented-out `.package(url:)`
  isn't counted as a declared dependency.
- Swift fragility signal also flags preconditionFailure( / assertionFailure(.

Tests: is_test_path swift cases, a no-print-in-lib Tests/ exclusion test, and a
commented-dep case in the swift deps test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tizz98
tizz98 merged commit a735f19 into main Jul 17, 2026
4 checks passed
@tizz98
tizz98 deleted the feat/swift-profile branch July 17, 2026 23:48
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