feat: add bats-setup-suite-path lint rule (#55)#61
Open
olavostauros wants to merge 4 commits into
Open
Conversation
Adds mise-shiv-plugin lint rule that flags mise.toml files declaring shiv-managed tools without the required [plugins] shiv entry and [settings] experimental = true. Based on the CI failure observed in KnickKnackLabs/chat#39. Includes 11 BATS tests across 7 fixture scenarios, plus an ignore directive on an existing github-actions fixture that declares shiv tools. Implements KnickKnackLabs#34 (KnickKnackLabs/codebase)
Adds bats-setup-suite-path lint rule that flags test/setup_suite.bash files calling `mise env` without preserving BATS_LIBEXEC first. BATS 1.13.0 relies on libexec path resolution; mise env can rewrite PATH and drop bats's libexec directory, causing 'bats-exec-file: command not found' before any tests run. Follows established file-discovery + scan pattern. ShellCheck-clean (SC2016 excluded on intentional code-snippet echo lines). Implements KnickKnackLabs#55 (KnickKnackLabs/codebase)
mise requires task files under .mise/tasks/ to be executable (mode 755) to discover them. Both bats-setup-suite-path and mise-shiv-plugin were committed as 644 (non-executable), causing mise run to report "no task found" and all functional BATS tests to fail.
This was referenced Jun 26, 2026
Closed
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.
Summary
Adds
bats-setup-suite-pathlint rule that flagstest/setup_suite.bashfiles callingmise envwithout preservingBATS_LIBEXECfirst. BATS 1.13.0 relies on libexec path resolution;mise envcan rewrite PATH and drop bats's libexec directory, causingbats-exec-file: command not foundbefore any tests run.The rule:
test/setup_suite.bashmise env, checks thatBATS_LIBEXEC(or${BATS_LIBEXEC:-}) is captured before themise envcallFAILwith the safe shape as a remedy hintcodebase:ignore bats-setup-suite-pathat repo-level and inlineAlso included in this PR (from the
feat/mise-shiv-pluginbranch):mise-shiv-pluginlint rule: checks thatmise.tomlhas the shiv plugin entry andexperimental = truewhen declaring shiv-managed tools# ==========...) to single-line comments across existing test filescodebase:ignore mise-shiv-pluginto thefix-lints-provisionedfixture to prevent cross-rule false positivesFiles changed
.mise/tasks/lint/bats-setup-suite-path.mise/tasks/lint/mise-shiv-plugintest/lint/bats-setup-suite-path/test/lint/mise-shiv-plugin/test/lint/*.bats(8 files) +test/lib/shell-files.batstest/lint/github-actions/fixtures/fix-lints-provisioned/mise.tomlcodebase:ignore mise-shiv-pluginValidation
mise run test— 239/239 pass (10 new tests for bats-setup-suite-path at indices 7–16, 11 new tests for mise-shiv-plugin, zero regressions)mise run lint:bats-setup-suite-path .— self-hosting clean (codebase repo has notest/setup_suite.bash)mise run lint:shellcheck .mise/tasks/lint/bats-setup-suite-path .mise/tasks/lint/mise-shiv-plugin— ShellCheck-clean (SC2016 excluded on intentional code-snippet echo lines, per established convention)git diff --check— no whitespace errorsCloses #55