Skip to content

Migrate from Mint to mise for tool management#139

Merged
leogdion merged 9 commits intov0.0.4from
138-mise
Apr 4, 2026
Merged

Migrate from Mint to mise for tool management#139
leogdion merged 9 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: a178ead0-a933-46f2-840b-768451320bb8

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 78.46%. Comparing base (2862d16) to head (84d0d11).
⚠️ Report is 4 commits behind head on v0.0.4.

Additional details and impacted files
@@            Coverage Diff             @@
##           v0.0.4     #139      +/-   ##
==========================================
+ Coverage   77.87%   78.46%   +0.59%     
==========================================
  Files         126      126              
  Lines        4555     4555              
==========================================
+ Hits         3547     3574      +27     
+ Misses       1008      981      -27     
Flag Coverage Δ
spm 77.87% <ø> (+0.02%) ⬆️
swift-6.0 78.13% <ø> (?)
swift-6.1 77.87% <ø> (?)
swift-6.2 78.15% <ø> (?)
swift-6.3 78.00% <ø> (+0.13%) ⬆️
ubuntu 78.44% <ø> (+0.57%) ⬆️

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.

periphery has no Linux binaries (SourceKit is macOS-only), so mise fails
to install it on ubuntu CI runners. Use mise platforms filter to skip it
on Linux — periphery was already excluded from CI execution in lint.sh.

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

claude bot commented Apr 4, 2026

Code Review: Migrate from Mint to mise for tool management

Overall this is a clean, well-structured migration. Removal of the Mint path-detection boilerplate is a clear win, and pinning versions in .mise.toml is exactly right.

Positives

  • Pinned exact versions for all three tools — deterministic builds.
  • Restricting periphery to macos-arm64/macos-x64 is correct (SourceKit is macOS-only), and the commit message explains the reasoning well.
  • Quoting PACKAGE_DIR in the pushd call fixes a latent bug with paths containing spaces.
  • The comment explaining the community asdf plugin for swift-format is helpful context.
  • CI workflow is significantly simpler: 20+ lines of clone/cache/install replaced by 2.

Issues / Suggestions

  1. Hardcoded copyright year (Scripts/lint.sh): The header.sh call now passes -y 2025, but today is already 2026. This will stamp all copyright headers with the wrong year. Consider using $(date +%Y) instead, or omit -y if header.sh auto-detects the year.

  2. eval "$(mise env)" runs in CI: The mise env evaluation is not guarded by the same [ -z "$CI" ] check as mise install above it, so it runs unnecessarily in CI where mise-action has already set up PATH. Either guard it with [ -z "$CI" ] or add a comment explaining why it is intentionally run in both environments.

  3. jdx/mise-action@v4 not pinned to a SHA: Using a mutable tag means the action can change under you. Pinning to a commit SHA is the GitHub hardening recommendation. Low risk for a well-known action, but worth noting.

  4. Double-space in swift-format lint invocations: There is a double space between --parallel and $SWIFTFORMAT_OPTIONS in both swift-format lint calls — carried over from before. Harmless, but easy to clean up.

Minor Notes

  • Formatting changes to CodeBlockExtractor.swift and Settings.swift appear to be auto-applied by the updated swift-format version — expected and fine.
  • CLAUDE.md version updates are correct and match the .mise.toml pins.

Summary: Approve with the copyright year fix as the only meaningful concern (today is 2026, not 2025). The rest are minor polish items.

…sting

Use mise os conditional to skip periphery on Linux (macOS-only tool).
Temporarily remove lint job dependencies to speed up CI testing.

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

claude bot commented Apr 4, 2026

Title: PR Review: Migrate from Mint to mise for tool management

Content:
Overall this is a solid improvement. mise is much easier to set up than cloning and building Mint from source in CI. The simplification to Scripts/lint.sh is welcome. A few things worth addressing:

Bug: Hardcoded copyright year
In Scripts/lint.sh the header.sh call now has -y 2025 hardcoded. The current year is 2026, so every run will stamp incorrect copyright headers. Consider using -y $(date +%Y) or removing the flag if the script already derives the year dynamically.

CI Regression: Empty needs list
The original lint job depended on [build-ubuntu, build-macos, build-windows, build-macos-full, build-android]. That list is now empty (needs: []), so lint runs immediately without waiting for any build. If this is intentional, it should be called out explicitly since it is a meaningful behavioral change.

Reliability: Community asdf plugin for swift-format
The .mise.toml uses asdf:eelcokoelewijn/asdf-swift-format which is a third-party community plugin that builds swift-format from source. If the plugin repo disappears or breaks, CI will fail on tool installation. Worth noting as a fragile dependency.

Minor: Silent failure when mise is absent locally
The lint.sh guard silently skips mise setup if mise is not installed, causing confusing "command not found" errors for swift-format and swiftlint. An else branch with a clear error message would help local developers.

Positives

  • Unquoted variable fix (pushd $PACKAGE_DIR to pushd "$PACKAGE_DIR") is correct
  • Trailing whitespace cleanup on else is good
  • CLAUDE.md tool version updates (SwiftFormat 602.0.0, SwiftLint 0.63.2, Periphery 3.7.2) are correct

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@leogdion leogdion merged commit e927cc0 into v0.0.4 Apr 4, 2026
37 of 38 checks passed
@leogdion leogdion deleted the 138-mise branch April 4, 2026 22:00
@claude
Copy link
Copy Markdown

claude bot commented Apr 4, 2026

PR Review: Migrate from Mint to mise for tool management

Overall this is a solid improvement — removing the fragile Mint bootstrap (cloning from source on Ubuntu) in favour of mise simplifies the CI setup meaningfully. A few issues worth addressing:


Bugs

Hardcoded copyright year is wrong (Scripts/lint.sh, header.sh call)

$PACKAGE_DIR/Scripts/header.sh -d  $PACKAGE_DIR/Sources -c "Leo Dion" -o "BrightDigit" -p "SyntaxKit" -y 2025

Today is 2026-04-04, so -y 2025 will stamp all file headers with the wrong year. Either remove the -y flag and let header.sh use the current year, or use -y $(date +%Y) for a dynamic value.


Code Quality

swift-format lint and swiftlint lint are invoked twice (Scripts/lint.sh)

Both tools run once under the FORMAT_ONLY guard, then again unconditionally after header.sh. This doubles lint time. If the intent is to catch header-introduced violations in a second pass, a comment explaining this would help; otherwise the second invocation appears redundant.

Double space in format command

run_command swift-format format $SWIFTFORMAT_OPTIONS  --recursive --parallel ...

Minor, but there are two spaces before --recursive.

run_command branches are identical

The run_command function has the same body in both the STRICT and non-STRICT branches — they both do "$@" || ERRORS=$((ERRORS + 1)). The conditional is dead code. (Pre-existing issue, but easy to clean up since this PR touches the function.)


Security / Reliability

jdx/mise-action@v4 pinned to a floating major version tag

Using a mutable tag means the action can silently update. For reproducibility and supply-chain safety, pin to an exact version (e.g. jdx/mise-action@v4.4.2) or a commit SHA.

Community swift-format asdf plugin

The .mise.toml uses an unofficial third-party plugin (asdf:eelcokoelewijn/asdf-swift-format) that builds swift-format from source. This is slower than a binary install and depends on an unmaintained community plugin (last commit 2023). It's worth adding a note in the PR/README about potential build time impact in CI, and tracking whether an official binary release becomes available.


Nits

  • The mise install guard (if [ -z "$CI" ]) correctly skips installation in CI (handled by mise-action), but a brief inline comment would help future readers understand why.
  • pushd "$PACKAGE_DIR" now correctly quotes the path — good fix.
  • .mise.toml comment referencing the plugin repo is helpful.

Summary: The migration itself is sound. The copyright year bug is the most urgent fix; the rest are polish. The lint-tool double-invocation is worth clarifying or removing.

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