Skip to main content

Module markdown_linter_lookup

Module markdown_linter_lookup 

Source
Expand description

Where the markdown/autofix policy finds monochromatic-lint: absolute PATH entries only. What: Find the monochromatic-lint executable the markdown/autofix policy runs, on the PATH of the invocation’s environment. Why: Repository configuration cannot choose the program (doc/planning/cli-git-rust-implementation.md, lines 181 to 189: first-party linter selection is installation wiring). The linter is installed through mise as cargo:monochromatic-lint, and mise exposes installed tools on PATH, through mise activate or its shims directory; real Git is found on PATH the same way. Only absolute PATH entries are searched: a relative or empty entry names a directory relative to where the command runs, usually inside the very repository whose content the linter checks, and that repository must not be able to supply the program.

In TS you’d write (pseudocode):

// const linter = findLinter(env.PATH); // '/home/u/.local/share/mise/shims/monochromatic-lint'

Constants§

LINTER_NAME
The linter’s executable name without the platform’s suffix.

Functions§

find_linter
What: The first absolute PATH entry holding an executable regular file of the linter’s name, following symbolic links. Option<&OsStr> is the PATH value or nothing. Why: This is the shell’s lookup order, without the entries that would let the checked repository choose the program. None means the linter is not installed where this invocation can see it, which the policy reports as a failure.
linter_file_name
What: The linter’s file name on this platform: monochromatic-lint, or with .exe on Windows. std::env::consts::EXE_SUFFIX is the platform’s executable suffix. Why: Cargo installs the executable under exactly this name.