livery.workshop._clean¶
livery.workshop._clean ¶
fm clean: restore this working tree to a fresh checkout of HEAD.
clean restores the working tree; workflow.abort stops a
workflow. This verb's object is the thing people mean by "clean":
the working tree in front of them.
Two safety properties, both about irreversibility:
- A machine secret is never collectable.
*.env.localholds values that exist in no git history, so removing one cannot be undone by any checkout. It survives--all, which is otherwise the take-the-gitignored-output-too switch. - The destructive step is deliberate. What will be discarded is
listed first and confirmed. Not a
--forceflag, a verb whose whole purpose is discarding must not refuse in the exact case you would reach for it, but not silent either.
Classes:
| Name | Description |
|---|---|
CleanPlan |
What a clean would do, before it does any of it. |
Functions:
| Name | Description |
|---|---|
protected_within |
The machine secrets beneath candidate, relative to root. |
plan_clean |
What |
render_plan |
The listing shown before the confirmation. |
clean_tree |
Restore the tree, after listing and confirming what that costs. |
clean |
Restore the working tree to a fresh checkout of HEAD. |
Attributes:
| Name | Type | Description |
|---|---|---|
PROTECTED_SUFFIX |
|
CleanPlan
dataclass
¶
protected_within ¶
The machine secrets beneath candidate, relative to root.
A directory removed whole takes every secret nested in it, so a caller that removes directories asks here first. The untracked enumeration collapses an untracked directory into one entry, so a secret nested inside it never reaches the name check: the clean takes such a directory one file at a time instead, and the sync's sweep of a removed package's leftovers keeps it.
Source code in packages/workshop/src/livery/workshop/_clean.py
plan_clean ¶
What clean would discard here; a pure read, no changes.
--all (everything) widens the untracked sweep to gitignored
files too (build output, caches), the only difference between
the two modes besides the count.
Source code in packages/workshop/src/livery/workshop/_clean.py
render_plan ¶
The listing shown before the confirmation.
Source code in packages/workshop/src/livery/workshop/_clean.py
clean_tree ¶
Restore the tree, after listing and confirming what that costs.
Source code in packages/workshop/src/livery/workshop/_clean.py
clean ¶
clean(all: Annotated[bool, doc('also remove gitignored files (build output)')] = False, yes: Annotated[bool, doc('skip the confirmation')] = False) -> None
Restore the working tree to a fresh checkout of HEAD.
Lists what a clean would discard, asks, then restores tracked
files and removes untracked ones. *.env.local files are kept
at any depth under any flag: a machine secret exists in no git
history, so removing one cannot be undone.