Skip to content

feat(mise): add fmt mise task for per-language formatting - #1222

Merged
malept merged 5 commits into
mainfrom
malept-claude/vigilant-lovelace-nkn96o
Sep 29, 2026
Merged

malept merged 5 commits into
mainfrom
malept-claude/vigilant-lovelace-nkn96o

Conversation

@malept

@malept malept commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

What this PR does / why we need it

Adds mise run fmt and mise run fmt:<name> (one per built-in formatter) as a mise-native alternative to make fmt. The per-linter execution logic that used to live inline in shell/fmt.sh's loop is now shell/run-formatter.sh, shared by both the existing serial make fmt path and the new per-language mise tasks. The fmt aggregator depends on fmt:*, 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:kubecfg is intentionally omitted: shell/linters/kubecfg.sh's formatter() is a no-op, so there's nothing for a dedicated task to run. make fmt is 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, and mise run never attaches a real tty to a task's stdin, serial or parallel, so no change was needed to the existing terminal-cursor handling in shell/lib/shell.sh.

This is scoped to fmt only. DT-5182 (migrating make lint) and DT-5432 (deprecating make fmt) are follow-ups that build on this design.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ME7x62LMxbvJ5dmyS3i51N


Generated by Claude Code

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
malept marked this pull request as ready for review September 29, 2026 02:29
@malept
malept requested a review from a team as a code owner September 29, 2026 02:29
@getoutreach-ci-1

Copy link
Copy Markdown
Contributor

Link to code coverage report (posted by coverbot 🤖)

@malept
malept merged commit 9dedfa0 into main Sep 29, 2026
14 checks passed
@malept
malept deleted the malept-claude/vigilant-lovelace-nkn96o branch September 29, 2026 19:02
@getoutreach-ci-2

Copy link
Copy Markdown

🎉 This PR is included in version 2.40.0-rc.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants