Skip to content

Add markdown-requires-ref-body lint to flag unmentioned requires items - #168

Open
cats2101 wants to merge 1 commit into
ethereum:masterfrom
cats2101:requires-in-body-lint
Open

Add markdown-requires-ref-body lint to flag unmentioned requires items#168
cats2101 wants to merge 1 commit into
ethereum:masterfrom
cats2101:requires-in-body-lint

Conversation

@cats2101

Copy link
Copy Markdown
Contributor

Closes #135.

Counterpart to the existing preamble-requires-ref-* family: walks the body collecting EIP-N / ERC-N mentions (skipping code blocks, inline code, and HTML — same skip set as markdown-refs) and reports each item in requires: whose number never appears in the body. Both EIP-N and ERC-N satisfy a requires: N entry.

The lint is added as markdown::RequireReferenced and wired through DefaultLint, but is intentionally not enabled by default in this PR. The eipv test corpus has several fixtures with requires: headers but no body references, and adding link-style references to keep them passing would cascade into markdown-link-first and markdown-link-status checks. 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 green
  • cargo fmt --check -p eipw-lint
  • cargo clippy -p eipw-lint --tests — no new warnings

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.
@SamWilsn

SamWilsn commented May 8, 2026

Copy link
Copy Markdown
Collaborator

I think we'd want this as a default. How painful is changing the eipv suite?

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.

Add lint ensuring proposals mentioned in requires appear somewhere in the body

2 participants