Skip to content

Migrate from Mint to mise for tool management#139

Open
leogdion wants to merge 6 commits intov0.0.4from
138-mise
Open

Migrate from Mint to mise for tool management#139
leogdion wants to merge 6 commits intov0.0.4from
138-mise

Conversation

@leogdion
Copy link
Copy Markdown
Member

@leogdion leogdion commented Apr 3, 2026

Summary

  • Replaces Mintfile and Mint with a .mise.toml configuration for managing swift-format, swiftlint, and periphery
  • Updates the CI lint job to use jdx/mise-action@v4 (with caching) on macos-latest instead of cloning/building Mint from source on Ubuntu
  • Simplifies Scripts/lint.sh by removing all Mint-specific path detection and wrapper logic — tools are called directly

Test plan

  • Run mise install locally and verify all three tools are installed
  • Run ./Scripts/lint.sh locally and verify it completes successfully
  • Confirm the Linting job passes in GitHub Actions on the PR

🤖 Generated with Claude Code


Perform an AI-assisted review on CodePeer.com

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d785abaa-35ac-4a71-8196-8b3f6019fab0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 138-mise

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

leogdion and others added 2 commits April 3, 2026 15:40
…ner [ci skip]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude bot commented Apr 3, 2026

Code Review

Summary

This is a nice simplification — removing the complex OS-detection Mint logic in favour of mise is a clear win. A few things worth addressing:


Issues

1. mise install and eval "$(mise env)" bypass error handling

In Scripts/lint.sh, the Mint bootstrap was wrapped in run_command, but the new calls aren't:

mise install          # not wrapped
eval "$(mise env)"    # not wrapped

If mise install fails (e.g. network issue, bad version), the script continues silently. These should either use run_command or set -e should be confirmed to be in effect.

2. Significant version bumps not called out

The .mise.toml silently upgrades tool versions vs. the old Mintfile:

  • swiftlint: 0.58.2 → 0.63.2
  • periphery: 3.0.1 → 3.7.2
  • swift-format: 600.0.0 → 602.0.0

That's 5 minor versions of SwiftLint and 4 of Periphery. These could introduce new lint warnings/errors that break CI. Worth explicitly noting in the PR and verifying lint still passes cleanly.

3. Community asdf plugin for swift-format

"asdf:eelcokoelewijn/asdf-swift-format" = "602.0.0"

This relies on a third-party community plugin rather than an official source. If the plugin is abandoned or its registry changes, CI breaks silently. Consider whether there's a more official/stable way to install swift-format via mise (e.g. via a pre-built binary or Homebrew backend).

4. Lint runs twice (pre-existing, but now more visible)

In lint.sh, swiftlint lint and swift-format lint each run twice — once inside the if [ -z "$FORMAT_ONLY" ] block and once unconditionally after the header.sh call. This was in the original but becomes more obvious now that the script is simpler. Worth cleaning up.


Positives

  • Removes ~30 lines of fragile OS-detection and path-wiring logic
  • jdx/mise-action@v4 with cache: true gives caching for free — cleaner than the manual Mint cache setup
  • Consistent tool invocation whether running locally or in CI

Minor

  • The trailing space on else else fix is a nice cleanup

leogdion and others added 2 commits April 3, 2026 16:40
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude bot commented Apr 3, 2026

PR Review: Migrate from Mint to mise for tool management

Overall this is a clean migration that significantly simplifies the CI setup. The removal of the Mint bootstrap-from-source step on Linux is a welcome improvement. A few things to note:

Potential Issues

Tool version bumps (.mise.toml)
The versions have jumped considerably from what was in the Mintfile:

  • SwiftLint: 0.58.2 to 0.63.2
  • Periphery: 3.0.1 to 3.7.2
  • swift-format: 600.0.0 to 602.0.0

These are significant upgrades that may introduce new lint rules or behavior changes. If CI was green before, it should be verified that these new versions do not produce new violations - especially SwiftLint 0.63.x which introduced several rule changes.

Third-party asdf plugin for swift-format

This uses a community asdf plugin (asdf:eelcokoelewijn/asdf-swift-format) rather than an official mise or asdf backend. If this plugin goes unmaintained or the repository is deleted/renamed, installs will silently break. Consider documenting this dependency, or check if mise has added official swift-format support since this was written.

jdx/mise-action@v4 not pinned to a SHA

Using a mutable tag means the action can be silently updated. For supply-chain safety, pinning to a specific commit SHA is recommended. This applies to the actions/checkout@v6 references in the workflow as well.

eval "$(mise env)" runs unconditionally
In lint.sh, mise install is guarded by [ -z "$CI" ], but eval "$(mise env)" runs regardless. This is correct for CI (mise is set up by the action), but if someone runs lint.sh without mise installed locally, they will get a confusing failure. Consider adding a command -v mise check before evaluating.

Minor Issues

Duplicate lint runs (pre-existing)
lint.sh runs swiftlint and swift-format twice - once inside the [ -z "$FORMAT_ONLY" ] block and again unconditionally after the header.sh call. This was not introduced by this PR but is worth cleaning up.

CLAUDE.md lists outdated tool versions
The CLAUDE.md Quality Tools section still references SwiftFormat 600.0.0, SwiftLint 0.58.2, and Periphery 3.0.1. Should be updated to reflect the new versions in .mise.toml.

Unquoted $PACKAGE_DIR in pushd
pushd $PACKAGE_DIR - paths with spaces would break this. Should be pushd "$PACKAGE_DIR" (pre-existing but still present).

What's Good

  • Removing the Mint clone-and-build step eliminates a fragile network dependency
  • mise-action has built-in caching (cache: true) which should improve CI performance
  • The lint.sh script is meaningfully simpler and easier to maintain
  • Mass copyright year update (2025 to 2026) is good housekeeping

@claude
Copy link
Copy Markdown

claude bot commented Apr 3, 2026

Code Review: Migrate from Mint to mise

Well-scoped migration that simplifies CI. A few observations:

Positives

  • Removing the git-clone-Mint-from-source pattern is a clear CI reliability win
  • mise-action@v4 with cache: true is idiomatic
  • Removing OS-detection logic in lint.sh simplifies maintenance
  • Skipping mise install in CI (action handles it) and only locally is correct

Concerns

  1. Version bumps - swiftlint 0.58.2→0.63.2, periphery 3.0.1→3.7.2, swift-format 600→602. SwiftLint sometimes enables new rules across minor versions. Test plan covers this locally, but worth noting.

  2. asdf plugin is a third-party dep - asdf:eelcokoelewijn/asdf-swift-format is maintained by an individual. If the repo disappears, mise install breaks. Consider a more stable source (ubi backend, Homebrew tap) as a follow-up.

  3. Silent eval "$(mise env)" failure - If the mise action does not put shims on PATH, eval succeeds but tools resolve from the system PATH instead. A sanity check like mise which swiftlint before linting would surface this early.

  4. Hardcoded -y 2025 in header.sh - Intentional to avoid spurious diffs presumably, but a comment explaining this would help future contributors.

  5. Minor - Extra blank line at end of lint.sh after final fi.

Summary: Migration direction is sound. Confirm CI passes with these tool versions. The asdf plugin dependency is the only structural concern for a follow-up.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.98%. Comparing base (2862d16) to head (e008d95).

Additional details and impacted files
@@            Coverage Diff             @@
##           v0.0.4     #139      +/-   ##
==========================================
+ Coverage   77.87%   77.98%   +0.10%     
==========================================
  Files         126      126              
  Lines        4555     4555              
==========================================
+ Hits         3547     3552       +5     
+ Misses       1008     1003       -5     
Flag Coverage Δ
spm 77.84% <ø> (ø)
swift-6.0 77.87% <ø> (?)
swift-6.1 77.89% <ø> (?)
swift-6.2 77.93% <ø> (?)
swift-6.3 77.87% <ø> (ø)
ubuntu 77.98% <ø> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@claude
Copy link
Copy Markdown

claude bot commented Apr 3, 2026

Code Review

Summary: Migrates from Mint to mise for managing swift-format, swiftlint, and periphery. The approach is sound and the CI simplification is a net improvement.

Observations and issues:

Third-party asdf plugin for swift-format: The .mise.toml uses "asdf:eelcokoelewijn/asdf-swift-format", which relies on an individual-maintained asdf plugin rather than an official channel. This is a supply-chain risk — if the plugin is abandoned or compromised, swift-format installs could silently break or pull unexpected content. Consider whether there is an official mise/aqua backend for swift-format, or at minimum document this dependency.

Significant version bumps — verify compatibility: The tool versions jumped substantially: swiftlint 0.58.2 -> 0.63.2, periphery 3.0.1 -> 3.7.2, swift-format 600.0.0 -> 602.0.0. The test plan mentions running lint locally but does not call out verifying that no new lint errors or periphery findings are introduced by the upgrades. It is worth explicitly confirming CI passes with the new rule sets before merging.

Hardcoded copyright year: -y 2025 is hardcoded in lint.sh. This will be incorrect next year without a manual follow-up change.

CLAUDE.md version references are now stale: The project-level CLAUDE.md lists the old versions (SwiftFormat 600.0.0, SwiftLint 0.58.2, Periphery 3.0.1). These should be updated alongside the Mintfile removal.

Minor — unquoted variable in pushd: pushd $PACKAGE_DIR (and other shell variable uses in lint.sh) are not quoted. If the path ever contains spaces, this will break. Quoting is cheap and eliminates the risk.

What looks good: Removing the Mint clone-from-source setup in CI significantly simplifies the lint job. The mise-action cache flag is a nice touch. Directly invoking tools without a Mint wrapper reduces indirection and failure modes.

Verdict: Mostly good direction. The asdf plugin concern and the stale CLAUDE.md versions are worth addressing before merging.

…E.md versions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude bot commented Apr 3, 2026

PR 139 Code Review - Migrate from Mint to mise

Overall this is a good improvement. Removing the Mint install-from-source-on-Linux approach simplifies the CI considerably.

Issue 1 - Hardcoded copyright year in lint.sh

The -y 2025 flag in the header.sh invocation hardcodes the year and will silently produce incorrect copyright headers next year. Consider -y $(date +%Y) instead, or removing the flag if header.sh can determine the year dynamically.

Issue 2 - jdx/mise-action@v4 is not pinned to a specific version

Using a floating major tag for a third-party action has the same supply chain risk as noted for the swift-build action. Consider pinning to a specific release (e.g. jdx/mise-action@v2.1.8) or a commit SHA.

Issue 3 - Significant version bumps not called out

swiftlint jumps from 0.58.2 to 0.63.2 (5 minor versions) and periphery from 3.0.1 to 3.7.2. New SwiftLint versions commonly add or change rules. The PR description doesn't confirm that lint still passes clean on existing code with the new versions.

Non-blocking observations (good)

  • The mise env guard in lint.sh correctly handles developers without mise installed.
  • The mise install skip in CI is correct since mise-action already runs it.
  • The community asdf plugin comment in .mise.toml is helpful context for future contributors.
  • Formatting changes in Settings.swift and CodeBlockExtractor.swift look correct under the new swift-format 602.0.0 rules.

Please check off the test plan items in the PR description before merging.

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