Skip to content

Lint #USAGE field ordering #53

Description

@junior-ricon

Problem

#USAGE directive fields are hand-written across mise tasks, and field ordering is easy to drift. In KnickKnackLabs/shell#12, Or noted that a directive like:

#USAGE arg "input" default="" help="Input to send" var=#true

would be more readable/consistent with structural fields earlier, e.g. var=#true before prose help, and likely before default="" as well.

Proposal

Add a codebase lint rule for #USAGE field ordering in mise task comments.

Possible canonical ordering, to refine while implementing:

  1. directive kind / name, e.g. arg "input" or flag "--raw"
  2. structural parser fields, e.g. var=#true
  3. defaults / value metadata, e.g. default=""
  4. human-facing prose, e.g. help="..."

Notes

  • The rule should probably start as autofixable or at least produce a clear expected-order diagnostic.
  • It should avoid changing quoted strings or directive semantics.
  • Source prompt: Or review comment on KnickKnackLabs/shell#12.

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