feat(lint): add mise-usage-examples rule — enforce #USAGE example for public tasks (#43)#70
Open
olavostauros wants to merge 1 commit into
Open
Conversation
olavostauros
force-pushed
the
feat/mise-usage-examples
branch
from
June 25, 2026 16:09
f8f57fb to
9cb6ad9
Compare
This was referenced Jun 26, 2026
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 a new lint rule
mise-usage-examplesthat flags public.mise/tasks/*files with#USAGE arg/flag directives but no#USAGE exampledirectives. Generalizes the check already done bybats-test-task(which only checks.mise/tasks/test) to all tasks.Fixes #43.
Detection
$target/.mise/tasks/*files#MISE hide=true#USAGE arg/#USAGE flagdeclarations#USAGE exampledirective when the task has a user-facing argument or flag surfacemise.toml, inline# codebase:ignore, rule-specific)Self-hosting
The codebase repo itself had 12 public tasks with args/flags but no examples — all have been fixed in this PR with appropriate
#USAGE exampledirectives.Fixtures (9 scenarios)
cleandirtyhidden#MISE hide=true, skippedboolean-onlyno-argsignored-inline# codebase:ignore, passesignored-repono-tasks.mise/tasks/dir, OKempty.mise/tasks/dir, OKmixedFiles changed
.mise/tasks/lint/mise-usage-examplestest/lint/mise-usage-examples/mise-usage-examples.batstest/lint/mise-usage-examples/fixtures/.mise/tasks/pre-commit#USAGE exampledirectives.mise/tasks/scan#USAGE exampledirective.mise/tasks/lint/_default#USAGE exampledirective.mise/tasks/lint/bats-test-helper#USAGE exampledirective.mise/tasks/lint/bats-test-task#USAGE exampledirective.mise/tasks/lint/caller-pwd-contract#USAGE exampledirective.mise/tasks/lint/github-actions#USAGE exampledirectives.mise/tasks/lint/gum-table#USAGE exampledirective.mise/tasks/lint/mcr-scope#USAGE exampledirective.mise/tasks/lint/mise-settings#USAGE exampledirectives.mise/tasks/lint/shellcheck#USAGE exampledirective.mise/tasks/migrate/task-pattern#USAGE exampledirectivesAGENTS.mdValidation
mise run test— 230/230 tests pass (12 new + 218 existing, zero regressions)codebase lint:mise-usage-examples .— self-hosting passes cleangit diff --check— no whitespace errors