Skip to content

feat(registry): switch shfmt to aqua backend#175

Merged
zeitlinger merged 1 commit intomainfrom
fix/aqua-shfmt
Apr 21, 2026
Merged

feat(registry): switch shfmt to aqua backend#175
zeitlinger merged 1 commit intomainfrom
fix/aqua-shfmt

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented Apr 16, 2026

Blocked by aquaproj/aqua-registry#52150

Summary

  • feat(shfmt): add Windows support aquaproj/aqua-registry#51964 (Windows support for shfmt) merged and released
  • Switch check_shfmt() from github:mvdan/sh to bare shfmt key (mise resolves via aqua:mvdan/sh)
  • Drop entire versioned_bin_fmt feature — shfmt was the only user
  • Remove mise_tools param from runner::run/prepare/build_invocations (no longer needed)
  • Add ("github:mvdan/sh", "shfmt") to OBSOLETE_KEYS for automatic migration hint
  • Update mise.toml, test fixtures, and renovate-tracked-deps.json

Test plan

  • CI passes (Linux, macOS, Windows)
  • flint update migrates github:mvdan/shshfmt in consumer repos

@zeitlinger zeitlinger marked this pull request as ready for review April 16, 2026 12:27
@zeitlinger zeitlinger requested a review from a team as a code owner April 16, 2026 12:27
Copilot AI review requested due to automatic review settings April 16, 2026 12:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/sh to aqua:shfmt, and add an OBSOLETE_KEYS mapping for migration hints.
  • Remove the versioned_bin_fmt / resolved-bin substitution plumbing and the mise_tools parameter from the runner pipeline.
  • Update cargo-clippy to include --tests and 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_bin is now an identity closure but build_invocations still allocates a new String for check_cmd/fix_cmd via cmd_template_buf = sub_bin(...). Since no substitution happens anymore, this can be simplified to use the &'static str templates 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.

Comment thread src/registry.rs Outdated
Comment thread src/registry.rs Outdated
@zeitlinger zeitlinger changed the title feat(registry): switch shfmt from github:mvdan/sh to aqua:shfmt feat(registry): switch shfmt to aqua backend, add --tests to cargo-clippy Apr 16, 2026
@zeitlinger zeitlinger marked this pull request as draft April 16, 2026 13:43
@zeitlinger
Copy link
Copy Markdown
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]>
@zeitlinger zeitlinger marked this pull request as ready for review April 21, 2026 06:02
@zeitlinger zeitlinger changed the title feat(registry): switch shfmt to aqua backend, add --tests to cargo-clippy feat(registry): switch shfmt to aqua backend Apr 21, 2026
@zeitlinger zeitlinger merged commit b62e336 into main Apr 21, 2026
15 checks passed
@zeitlinger zeitlinger deleted the fix/aqua-shfmt branch April 21, 2026 06:13
@github-actions github-actions Bot mentioned this pull request Apr 21, 2026
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>
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.

3 participants