Lint
Give fast lint and formatting feedback for the files changed in the current
worktree. This is an iterative cleanup lane, not authoritative release evidence;
/safeword:verify owns the project's full lint, type-check, build, and test suites.
Instructions
- Collect tracked and untracked changed files with
git diff --name-only --diff-filter=ACMR HEADandgit ls-files --others --exclude-standard. - Group them by language. Run every applicable language below in a polyglot project, but pass only those changed files (or their Go package directories).
- If there are no changed source files, report that and stop.
- Only when the user explicitly asks for a full lint, run the repository's
existing full lint/format scripts instead. Do not infer that request merely
because implementation finished;
/safeword:verifyis the full closing gate.
Use the repository's installed tools and configuration. Examples (<files...>
means the explicit changed-file list, never .):
# Python
ruff check --fix <changed-python-files...>
ruff format <changed-python-files...>
mypy <changed-python-files...>
# JavaScript / TypeScript
bunx eslint --fix -- <changed-js-ts-files...>
bunx prettier --write -- <changed-js-ts-files...>
# Go (translate changed .go files to unique package directory patterns)
golangci-lint run --fix <changed-go-package-patterns...>
golangci-lint fmt <changed-go-package-patterns...>
Do not append changed files to a script that already contains eslint .,
prettier ., or another repository-wide target: the . still expands the run
to the whole repository. Do not hide failures with || true; capture each exit
status, continue with the other applicable language groups, then report every
failure.
Summary
After running, report:
- The changed-file scope used, or that the user explicitly requested full scope
- Any linting errors that couldn't be auto-fixed (Ruff, ESLint, or golangci-lint)
- Any formatting issues
- Type errors reported by a targeted tool; remind the user that
/safeword:verifyowns authoritative project-wide type checking