Add lint ensuring proposals in 'requires' appear in the body#138
Open
sumitvekariya wants to merge 2 commits intoethereum:masterfrom
Open
Add lint ensuring proposals in 'requires' appear in the body#138sumitvekariya wants to merge 2 commits intoethereum:masterfrom
sumitvekariya wants to merge 2 commits intoethereum:masterfrom
Conversation
This implements a new markdown lint 'markdown-requires-ref-body' that ensures all proposals listed in the preamble 'requires' field are actually mentioned somewhere in the body of the document. Fixes ethereum#135 - Added RequiresRefBody lint in eipw-lint/src/lints/markdown/requires_ref_body.rs - Updated markdown module to export the new lint - Added the lint to known_lints.rs with proper From trait implementations - Added the lint to default configuration in config.rs - Added comprehensive test suite with 5 test cases - Added documentation in docs/markdown-requires-ref-body/index.html The lint recognizes both EIP-X and ERC-X format references in the body and reports an error for any missing references with proper source location information.
- Fix formatting in known_lints.rs for MarkdownRequiresRefBody - Fix formatting in requires_ref_body.rs for method chaining
SamWilsn
reviewed
Oct 14, 2025
Comment on lines
+75
to
+79
| let missing_str: Vec<String> = missing_eips.iter().map(|n| format!("EIP-{}", n)).collect(); | ||
| let label = format!( | ||
| "proposals {} must be mentioned in the body", | ||
| missing_str.join(", ") | ||
| ); |
Contributor
There was a problem hiding this comment.
Bit of a nitpick on my part, but putting the EIP- prefix might confuse authors into thinking that they have to add it to the requires: line. That's not to mention the confusion between ERC- and EIP- that this'll likely cause.
I think a simpler error message here would be more appropriate:
"proposals in the
{}field must be mentioned in the body", self.requires
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.
This implements a new markdown lint 'markdown-requires-ref-body' that ensures all proposals listed in the preamble 'requires' field are actually mentioned somewhere in the body of the document.
Fixes #135
The lint recognizes both EIP-X and ERC-X format references in the body and reports an error for any missing references with proper source location information.