Skip to main content

Module declared

Module declared 

Source
Expand description

Directories a project declares prunable, and the checks that let dev-prune act on one.

Every adapter in this tool earns the right to delete a directory the same way: it finds a lockfile, verifies the lockfile can rebuild what is about to go, and only then deletes. A declaration is that same bargain written by hand, for the tree no adapter can recognise — a generated fixture set, a vendored toolchain, a scratch cache with a make target behind it.

What makes that safe is not trust. project.devprune.json is committed, so a cloned repository can declare anything it likes, and devp run may be running from a scheduler with nobody watching. So a declaration is treated as a claim to be checked rather than an instruction to be followed: it names a directory, and this module proves the directory is inside the repository, holds nothing Git is tracking, and has a rebuild command whose tool this machine actually has. A claim that fails any of those is reported, in full, and nothing is deleted.

Structs§

Target
A declared directory that passed every check, ready to be treated as bloat.

Enums§

Declaration
What became of one entry in prunable.directories.

Functions§

resolve
Check every declaration in a repository, in the order the file lists them.