Expand description
The skif command line as a library: a thin consumer of the skif library.
It is the only code that reads the environment, prints, prompts, writes files, spawns a process and opens a network
connection (skif update only); run returns an exit code and no function below calls std::process::exit.
The npm addon calls run; the binary calls run_to_exit, which also changes the current directory under
bazel run and leaves the memory of a run to the operating system.
Structs§
- CliError
- A failure that stops skif from checking the repository.
- Lint
Cache - The cache of
lint_to_json_cached, as a host’s options give it; each field left unset falls back to the environment (SKIF_CACHE,SKIF_CACHE_DIR,SKIF_CACHE_MAX_SIZE), then[cache]of the root configuration, then the defaults (on, 512 MiB, the default location).
Enums§
- Kind
- Machine-readable category of a failure.
Functions§
- configure_
global_ pool - Builds rayon’s global pool, once per process, with 64 MiB stacks. The thread count still follows
RAYON_NUM_THREADS. A host that built the global pool first keeps its own. - lint_
to_ json - Lints the workspace containing
path, or withrecursiveevery root at or below it, and returns the report as the JSON documentskif --format json [-r] PATHprints, withoverridesin place of the flags that set configuration. - lint_
to_ json_ cached - Like
lint_to_json, through the cache store of the command line (ADR 0007), on unlesscacheor the environment turns it off: the report is the same, and the run reads and writes the store asskifdoes, with the same location chain, size cap and rule forCI. A cache that cannot be read or written never fails the lint. - run
- Runs the CLI with
args(the first item is the program name, as instd::env::args_os) and returns the exit code. The npm addon calls this; theskifbinary callsrun_to_exit, which differs only in what happens to memory and in entering thebazel rundirectory; everything else is shared, so their behaviour cannot drift. - run_
to_ exit - Like
run, for a process that exits as soon as this returns: the lint command leaves its diagnostics, workspace model and file caches to the operating system instead of freeing them one allocation at a time, a measurable part of a large run. Never call it from a long-lived host such as the npm addon: that memory would leak on every call.