command

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package command implements the `command` rule type (spec §5): the interim escape hatch for toolchain gates that cannot be expressed declaratively. It runs an external command at the repository root and interprets its exit code (and optionally its output). It is a heavy, whole-run rule: a failure to execute the tool is an engine error (exit 2), never a silent pass (spec §11). Every command rule is enumerated by `formwork lint` (spec §9).

The tool runs with the caller's environment INHERITED UNCHANGED — that is the escape hatch's contract, and this package removes nothing from it. It refuses two states instead, both in ensureRepositoryAgreement, and refusing is what lets the contract stand: nothing is deleted from the tool's environment.

  • an ambient POINTER variable (GIT_DIR, GIT_WORK_TREE, GIT_COMMON_DIR) naming a repository other than the one the engine is checking — the one state an identity comparison can SEE (#177);
  • any of the OBJECT-STORE family being set at all, which moves which commits and objects git answers from INSIDE the right repository and so is invisible to that comparison (#213).

Both are exit 2, never a finding, and both are lifted by FORMWORK_GIT_ENV= inherit — the same hatch internal/vcs uses, so an operator who has already taken that decision does not meet a second refusal spelled differently.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL