feat(mise): add fmt mise task for per-language formatting - #1222
Merged
Merged
Conversation
Adds `mise run fmt` and `mise run fmt:<name>` (one per built-in formatter) as a mise-native alternative to `make fmt`. Splits the per-linter-script execution logic out of shell/fmt.sh into a new shell/run-formatter.sh, shared by the existing serial `make fmt` loop and the new per-language mise tasks. The `fmt` aggregator task depends on `fmt:*`, so a downstream repo's own formatter task (file-based or TOML) joins the parallel run automatically without devbase needing to know about it in advance. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ME7x62LMxbvJ5dmyS3i51N
shell/linters/kubecfg.sh's formatter() is a no-op ({ true; }), so a
fmt:kubecfg mise task would claim to format something while doing
nothing. make fmt is unaffected: it still discovers and runs
kubecfg.sh's no-op formatter as before.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ME7x62LMxbvJ5dmyS3i51N
Replaces the sed-piped extensionsString construction with bash parameter expansion, dropping the SC2155/SC2001 shellcheck-disable comment it needed. Output is unchanged (e.g. ".sh,.bash,.bats"). The remaining SC1090 disable on `source "$linterScript"` stays: the path is a runtime argument, so shellcheck genuinely can't resolve it statically, and that's inherent to run-formatter.sh being a generic driver for any linter script rather than a fixable code smell. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ME7x62LMxbvJ5dmyS3i51N
scripts/shell-wrapper.sh is the existing, already-documented way consumer repos reach devbase's vendored shell scripts (it's what make fmt itself uses), rather than hardcoding the .bootstrap/shell vendor path directly. Verified end-to-end in a simulated consumer repo (devbase vendored under .bootstrap/, real service.yaml). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ME7x62LMxbvJ5dmyS3i51N
malept
marked this pull request as ready for review
September 29, 2026 02:29
Contributor
|
Link to code coverage report (posted by coverbot 🤖) |
marnagy
approved these changes
Sep 29, 2026
|
🎉 This PR is included in version 2.40.0-rc.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
What this PR does / why we need it
Adds
mise run fmtandmise run fmt:<name>(one per built-in formatter) as a mise-native alternative tomake fmt. The per-linter execution logic that used to live inline inshell/fmt.sh's loop is nowshell/run-formatter.sh, shared by both the existing serialmake fmtpath and the new per-language mise tasks. Thefmtaggregator depends onfmt:*, so a downstream repo's own formatter task, file-based or a plain TOML entry, joins the parallel run automatically without this repo needing to know about it in advance.Jira ID
DT-5431
Notes for your reviewers
fmt:kubecfgis intentionally omitted:shell/linters/kubecfg.sh'sformatter()is a no-op, so there's nothing for a dedicated task to run.make fmtis unaffected either way, it still runs all 9 linter scripts in series, unchanged.Two mise behaviors this design depends on were verified directly against the pinned CI image (mise 2026.8.9) rather than assumed from docs, since the docs were ambiguous on both:
depends=[{ task = "fmt:*", optional = true }]resolves and parallelizes outside monorepo mode, andmise runnever attaches a real tty to a task's stdin, serial or parallel, so no change was needed to the existing terminal-cursor handling inshell/lib/shell.sh.This is scoped to
fmtonly. DT-5182 (migratingmake lint) and DT-5432 (deprecatingmake fmt) are follow-ups that build on this design.🤖 Generated with Claude Code
https://claude.ai/code/session_01ME7x62LMxbvJ5dmyS3i51N
Generated by Claude Code