Expand description
Marker-delimited managed block: string surgery over a host file.
The canon owns exactly one region of a consumer’s .pre-commit-config.yaml
— the lines between its BEGIN and END markers — and everything here is a
pure function over the host text: validate the markers, strip the region,
splice a new one into the repos: sequence, and hash what is present.
Every line outside the markers passes through byte-identical. What the
block contains is the hook renderer’s business, and reading or writing
the file is the installer’s.
Enums§
- Marker
Error - A host file whose markers cannot be trusted, or that cannot host a block.
Constants§
Functions§
- block_
hash - The hash the manifest records for a host file’s managed region.
- block_
region - The managed region — BEGIN through END inclusive — as present in a host
text, or
Nonewhen no complete region exists. - splice
- Splice a rendered block (BEGIN through END, newline-terminated) into the
repos:sequence of a marker-free base, returning the new host text and the indentation the block’s entries should have used. - splice_
indent - The indentation a spliced block’s sequence items should carry, measured from the base the block will join.
- split_
block - Split a host text into its lines outside the managed region and the region itself, validating the markers first.