Skip to content

chore(hygiene): port the space-run literal guard (#3130) - #65

Draft
MichaelTaylor3d wants to merge 3 commits into
mainfrom
loop/3130-copy-hygiene
Draft

chore(hygiene): port the space-run literal guard (#3130)#65
MichaelTaylor3d wants to merge 3 commits into
mainfrom
loop/3130-copy-hygiene

Conversation

@MichaelTaylor3d

Copy link
Copy Markdown
Contributor

DO NOT MERGE — lane in progress

WIP for https://github.com/DIG-Network/dig_ecosystem/issues/3130 (port the space-run literal guard
that catches a lost \ string-continuation collapsing into a run of spaces mid-sentence).

Reference implementation: dig-installer/tests/copy_hygiene.rs (PR dig-installer#71, head 5020536)
— a line-boundary state machine (Code / Str / Raw(hashes)) that carries literal state across
line breaks, so it catches both the joined-onto-one-line shape and the lost-continuation shape.

Will update with: the ported guard, whatever it caught, the revert-proof (reintroduce one corruption,
confirm red with a real test count, restore, confirm green), and the dep-bump audit (§2.4b).

Refs https://github.com/DIG-Network/dig_ecosystem/issues/3130

…es (#3130)

Ports dig-node's merged reference implementation (continuation_guard.rs,
dig-node#526/#583) into every member of the digs workspace, adopting the settled
discriminator rather than inventing a second one: a non-comment line carrying a
run of 10 or more spaces is a defect, unless immediately followed by `//` or
covered by a per-file exclusion.

Each copy is byte-identical to the reference apart from its doc comment and a
per-crate MIN_FILES_SCANNED floor tuned to that crate's real .rs count, so a
walker that stops finding files fails the test instead of silently passing on
zero. All three exemption lists are empty in every crate.

Covers the 14 published workspace members. The two workspace-excluded crates
(digstore-prover/guest, dig-client-wasm) are not built by `cargo test
--workspace` and are out of scope.

This commit is the guard only; no string literal is changed by it.

Refs DIG-Network/dig_ecosystem#3130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant