Problem
With mise #USAGE tasks, task-owned flags should be passed directly. A -- separator before those flags can prevent mise/usage from parsing them.
Fresh example from KnickKnackLabs/notes#15 work:
run notes setup --yes -- --pattern "agents/*/Zettels/**"
After adding --yes, this invocation returned success but did not parse --pattern, so setup silently used the default pattern. The intended command was:
run notes setup --yes --pattern "agents/*/Zettels/**"
The current BATS guidance already says no -- separator is needed for declared #USAGE flags, but this is easy to forget and hard to spot in review.
Proposed lint
Warn on command invocations in shell/BATS files where a -- separator is immediately followed by a flag that belongs to the target mise task.
Possible conservative implementation:
- Parse
.mise/tasks/<task> for declared #USAGE flag long names.
- Scan test/shell files for invocations shaped like:
<tool> <task> ... -- --<flag>
mise run <task> ... -- --<flag>
- Warn only when
--<flag> is declared by that task.
This should stay a warning because some tasks intentionally forward raw flags to a nested command.
Related
- fold
bats-tool-testing.md — "No -- separator needed"
Problem
With mise
#USAGEtasks, task-owned flags should be passed directly. A--separator before those flags can prevent mise/usage from parsing them.Fresh example from KnickKnackLabs/notes#15 work:
run notes setup --yes -- --pattern "agents/*/Zettels/**"After adding
--yes, this invocation returned success but did not parse--pattern, so setup silently used the default pattern. The intended command was:run notes setup --yes --pattern "agents/*/Zettels/**"The current BATS guidance already says no
--separator is needed for declared#USAGEflags, but this is easy to forget and hard to spot in review.Proposed lint
Warn on command invocations in shell/BATS files where a
--separator is immediately followed by a flag that belongs to the target mise task.Possible conservative implementation:
.mise/tasks/<task>for declared#USAGE flaglong names.<tool> <task> ... -- --<flag>mise run <task> ... -- --<flag>--<flag>is declared by that task.This should stay a warning because some tasks intentionally forward raw flags to a nested command.
Related
bats-tool-testing.md— "No--separator needed"