Add markdown-requires-ref-body lint to flag unmentioned requires items - #168
Open
cats2101 wants to merge 1 commit into
Open
Add markdown-requires-ref-body lint to flag unmentioned requires items#168cats2101 wants to merge 1 commit into
requires items#168cats2101 wants to merge 1 commit into
Conversation
Closes ethereum#135. Counterpart to the existing `preamble-requires-ref-*` family: walks the body collecting EIP/ERC numbers (skipping code blocks, inline code, and HTML, like `markdown-refs`) and reports each item in `requires:` whose number never appears in the body. Both `EIP-N` and `ERC-N` mentions satisfy a `requires: N` entry. The lint is added as a new `markdown::RequireReferenced` and wired through `DefaultLint`, but is intentionally not enabled by default — the `eipv` test corpus has fixtures with `requires:` headers and no body references, and updating them to add link-style references would cascade into `markdown-link-first` and `markdown-link-status` checks. Maintainers can enable it in default config (or in the EIPs repo config) once those fixtures are reworked.
Collaborator
|
I think we'd want this as a default. How painful is changing the eipv suite? |
SamWilsn
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #135.
Counterpart to the existing
preamble-requires-ref-*family: walks the body collectingEIP-N/ERC-Nmentions (skipping code blocks, inline code, and HTML — same skip set asmarkdown-refs) and reports each item inrequires:whose number never appears in the body. BothEIP-NandERC-Nsatisfy arequires: Nentry.The lint is added as
markdown::RequireReferencedand wired throughDefaultLint, but is intentionally not enabled by default in this PR. Theeipvtest corpus has several fixtures withrequires:headers but no body references, and adding link-style references to keep them passing would cascade intomarkdown-link-firstandmarkdown-link-statuschecks. Happy to enable in defaults + rework those fixtures in a follow-up if you'd prefer.Test plan
cargo test -p eipw-lint --test lint_markdown_require_referenced— 7 cases (all referenced, one missing, two missing, missing field, ignores fenced code block, ignores inline code, ERC satisfies EIP)cargo test -p eipw-lint— full suite greencargo fmt --check -p eipw-lintcargo clippy -p eipw-lint --tests— no new warnings