Skip to content

Add lint ensuring proposals in 'requires' appear in the body#138

Open
sumitvekariya wants to merge 2 commits intoethereum:masterfrom
sumitvekariya:feat/markdown-requires-ref-body
Open

Add lint ensuring proposals in 'requires' appear in the body#138
sumitvekariya wants to merge 2 commits intoethereum:masterfrom
sumitvekariya:feat/markdown-requires-ref-body

Conversation

@sumitvekariya
Copy link
Copy Markdown
Contributor

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

  • 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.

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
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(", ")
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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