Skip to content

lint: warn on -- before task-owned #USAGE flags #39

Description

@brownie-ricon

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:

  1. Parse .mise/tasks/<task> for declared #USAGE flag long names.
  2. Scan test/shell files for invocations shaped like:
    • <tool> <task> ... -- --<flag>
    • mise run <task> ... -- --<flag>
  3. 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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions