Skip to content

Lints to ensure link text for EIPs should match the EIP's number #67

Open
@SamWilsn

Description

Let's create two lints:

markdown-link-eip

If the link destination matches the pattern eip-([^.]*)\.md$, trigger if the link text does not match ^(EIP|ERC)-\1$, where \1 is the proposal's number from the file name (aka capture group 1.)

For example:

  • [EIP-1](./eip-2.md)
  • [EIP-1: Foo](./eip-1.md)
  • [Another Proposal](./eip-1.md)

If the link destination matches the pattern eip-([^.]*)\.md#.+$, trigger if the link text does not match ^(EIP|ERC)-\1\s*\S+, where \1 is the proposal's number from the file name (aka capture group 1.) Note that this pattern allows trailing characters.

For example:

  • [EIP-1](./eip-1.md#motivation)
  • [EIP-2: Hello](./eip-1.md#abstract)
  • [Another Proposal](./eip-1.md#rationale)

markdown-link-other

If the link text begins with EIP or ERC, the link target must be an EIP. For example:

  • [EIP-2](../assets/eip-2/foo.txt)

Metadata

Labels

ready to implementFeature has reached rough consensus among editors and is ready to be implemented

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions