feat(registry): switch shfmt to aqua backend#175
Merged
zeitlinger merged 1 commit intomainfrom Apr 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Flint’s shfmt integration to use the aqua:shfmt mise tool key (now that aqua-registry has Windows support), and removes the previously-needed “versioned binary name” handling that existed primarily to support github:mvdan/sh.
Changes:
- Switch shfmt’s registry entry and all fixtures from
github:mvdan/shtoaqua:shfmt, and add anOBSOLETE_KEYSmapping for migration hints. - Remove the
versioned_bin_fmt/ resolved-bin substitution plumbing and themise_toolsparameter from the runner pipeline. - Update cargo-clippy to include
--testsand add/adjust E2E fixtures accordingly.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e.rs | Refactors TOML snapshot rewrite logic using let-chains (no behavior change intended). |
| tests/cases/shfmt/failure/files/mise.toml | Updates shfmt tool key to aqua:shfmt in fixture. |
| tests/cases/shfmt/clean/files/mise.toml | Updates shfmt tool key to aqua:shfmt in fixture. |
| tests/cases/shfmt/auto-fix/files/mise.toml | Updates shfmt tool key to aqua:shfmt in fixture. |
| tests/cases/editorconfig-checker/formatter-exclusion/files/mise.toml | Updates shfmt tool key to aqua:shfmt in fixture. |
| tests/cases/cargo-clippy/failure/test.toml | Updates expected stderr to match cargo clippy --tests behavior/output. |
| tests/cases/cargo-clippy/failure-in-tests/test.toml | Adds new fixture to assert clippy failures originating from tests. |
| tests/cases/cargo-clippy/failure-in-tests/files/src/lib.rs | Adds minimal Rust crate code triggering a test-only clippy failure. |
| tests/cases/cargo-clippy/failure-in-tests/files/mise.toml | Adds rust tool declaration for the new clippy fixture. |
| tests/cases/cargo-clippy/failure-in-tests/files/Cargo.toml | Adds minimal Cargo manifest (edition 2024) for the new fixture. |
| src/runner.rs | Removes mise_tools plumbing and versioned-bin substitution; simplifies invocation building. |
| src/registry.rs | Drops versioned_bin_fmt, switches shfmt key to aqua:shfmt, updates cargo-clippy to run --tests, adds obsolete-key migration entry. |
| src/main.rs | Removes mise_tools argument from runner calls after runner API simplification. |
| src/linters/renovate_deps.rs | Adds a targeted clippy allow for complex test helper type signature. |
| src/init/mod.rs | Refactors component merge logic using let-chains (no behavior change intended). |
| mise.toml | Switches repo’s shfmt tool declaration to aqua:shfmt. |
| .github/renovate-tracked-deps.json | Updates tracked mise tool list to include aqua:shfmt and drop github:mvdan/sh. |
Comments suppressed due to low confidence (1)
src/runner.rs:248
sub_binis now an identity closure butbuild_invocationsstill allocates a newStringforcheck_cmd/fix_cmdviacmd_template_buf = sub_bin(...). Since no substitution happens anymore, this can be simplified to use the&'static strtemplates directly and avoid the extra allocation/indirection.
let sub_bin = |t: &str| -> String { t.to_string() };
let cmd_template_buf;
let cmd_template: &str = if fix && check.has_fix() {
cmd_template_buf = sub_bin(fix_cmd);
&cmd_template_buf
} else {
cmd_template_buf = sub_bin(check_cmd);
&cmd_template_buf
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4 tasks
Member
Author
|
Note: cargo related changes are already merged - hence conflict |
zeitlinger
added a commit
that referenced
this pull request
Apr 18, 2026
Stacked on #187. Two small migrations derived from the flint-v2 design todos: ### 1. `shfmt` → `github:mvdan/sh` Bare `shfmt` resolves via aqua registry, which is broken in current mise releases. `github:mvdan/sh` works (paired with the existing `versioned_bin("shfmt_{version}")` wiring). Adds the mapping to `OBSOLETE_KEYS` so `flint update` rewrites existing mise.toml files non-interactively. Remove once [jdx/mise#9191](jdx/mise#9191) ships (v2026.4.17+) and #175 lands the bare `shfmt` restoration via `aqua:mvdan/sh`. ### 2. Auto-add `node` prereq for `npm:` backend tools npm-backed tools (prettier, biome, markdownlint-cli2, renovate) need the `npm` command, which needs a Node.js runtime. Without an explicit `node` entry, mise falls back to system node — may be absent, wrong version, or drift across machines, breaking the "reproducible lint environment" promise. `flint init` and `flint update` now detect this and pin `node@lts` via `mise use --pin` (resolves to a concrete version at write time). ## Test plan - [ ] Unit tests pass (`cargo test --bin flint`) - [ ] E2E tests pass (`cargo test --test e2e`) - [ ] Run `flint update` on a repo with `npm:prettier` but no `node` → adds node - [ ] Run `flint update` on a repo with bare `shfmt` → rewritten to `github:mvdan/sh` --------- Signed-off-by: Gregor Zeitlinger <[email protected]>
Signed-off-by: Gregor Zeitlinger <[email protected]>
bd00bda to
67f6cee
Compare
martincostello
approved these changes
Apr 21, 2026
Merged
zeitlinger
pushed a commit
that referenced
this pull request
Apr 21, 2026
### Added - *(registry)* switch shfmt to aqua backend ([#175](#175)) ### Fixed - treat cargo-clippy as a partial fixer ([#197](#197)) - *(registry)* add --tests to cargo-clippy, add test coverage ([#176](#176)) ### Other - *(deps)* update taiki-e/install-action digest to 055f5df ([#180](#180)) - *(deps)* update dependency npm:@biomejs/biome to v2.4.12 ([#191](#191)) - *(deps)* update rust crate clap to v4.6.1 ([#196](#196)) - *(deps)* update rust crate tokio to v1.52.1 ([#192](#192)) - *(deps)* update dependency pipx:ruff to v0.15.11 ([#198](#198)) - *(deps)* update node.js to v24.15.0 ([#194](#194)) - *(deps)* update dependency npm:prettier to v3.8.3 ([#193](#193)) - exclude mise install dir from Windows Defender ([#188](#188)) - *(deps)* update dependency npm:renovate to v43.129.0 ([#200](#200)) - restructure README/docs and split registry module ([#187](#187)) - *(deps)* update dependency mise to v2026.4.15 ([#199](#199)) > [!IMPORTANT] > Close and reopen this PR to trigger CI checks. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Blocked by aquaproj/aqua-registry#52150
Summary
check_shfmt()fromgithub:mvdan/shto bareshfmtkey (mise resolves viaaqua:mvdan/sh)versioned_bin_fmtfeature — shfmt was the only usermise_toolsparam fromrunner::run/prepare/build_invocations(no longer needed)("github:mvdan/sh", "shfmt")toOBSOLETE_KEYSfor automatic migration hintmise.toml, test fixtures, andrenovate-tracked-deps.jsonTest plan
flint updatemigratesgithub:mvdan/sh→shfmtin consumer repos