livery.workshop._commit¶
livery.workshop._commit ¶
The commit verb: a conventional commit on a proved tree.
Stages the change, derives the scope from the packages it touches,
runs the affected gate first so every commit sits on a proved tree,
validates the subject the way submit validates a title, and
commits. git commit keeps working; the verb is the spelling that
never mistypes the scope the release train reads and never commits an
unproved tree.
Functions:
| Name | Description |
|---|---|
scope_of |
The scope of a change to paths: the packages it touches, by directory. |
commit_flow |
Commit the change in root as |
commit |
Commit the change as |
scope_of ¶
The scope of a change to paths: the packages it touches, by directory.
Empty when the change touches no package (root files, notes), and the subject carries no scope then. Several packages join with a comma, the spelling the release train reads. A package whose changed paths are only the files the engine composes into it and their receipt is left out: a template's change renders into every package, and the change's scope is the template's owner, which the same change touches. The receipt is read as it stands and as it was at HEAD, so a composed file the change removes counts too.
Source code in packages/workshop/src/livery/workshop/_commit.py
commit_flow ¶
commit_flow(root: Path, type: str, subject: str, *, body: str = '', scope: str = '', only: str = '', breaking: bool = False, check: bool = True) -> str
Commit the change in root as type(scope): subject; the subject written.
The verb's act after its argument refusals, which another verb
calls to commit through the same rules: the balancer's submit
(livery.workshop._balance.submit) among them. Refuses on
main, on a reserved branch, and with nothing to commit. With
check the affected gate runs first in its fix mode; a caller
whose next step is a gate of the same tree passes False. The
scope is the packages the staged change touches (scope_of)
unless scope gives it; only stages those comma-separated paths
alone; breaking marks the break.
Raises:
| Type | Description |
|---|---|
Failed
|
naming the refusal, or git's words when it refuses the commit, the change left staged. |
Source code in packages/workshop/src/livery/workshop/_commit.py
commit ¶
commit(type: Arg[str] = '', subject: Arg[str] = '', body: Annotated[str, doc('the commit body, after the subject')] = '', scope: Annotated[str, doc('the scope; derived from the changed paths when absent')] = '', only: Annotated[str, doc('stage these paths alone, comma-separated; everything when absent')] = '', breaking: Annotated[bool, doc('mark the commit as a break (the ! before the colon)')] = False, check: Annotated[bool, doc('run the affected gate first, healing what is mechanical')] = True) -> None
Commit the change as type(scope): subject on a proved tree.
TYPE is one of the conventional types the release train reads and
SUBJECT says what the change does. The scope is the packages the
staged change touches, by directory name, or none for a change
outside every package; --scope overrides it. A package whose
only changes are the files the engine composes into it is left
out. The affected gate runs first in its fix mode, so mechanical
findings heal into the commit and nothing unproved is committed;
--no-check skips it. Everything is staged unless --only
names the paths. Refuses on main, on a reserved branch, and
with nothing to commit.