---
eip: 7199
label: EIP-7199
title: Linter Scope
status: Withdrawn
type: Meta
created: 2023-06-20
official: https://eips.ethereum.org/EIPS/eip-7199
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7199.md
canonical: https://eips.huatuo.xyz/zh/eip-7199/
lang: zh
tldr: 一个已撤回的流程提案：修改 EIP 的拉取请求无需修复其未改动行上的 linter 错误，除非它会更改该 EIP 的状态。
tags: [meta, process, linter, eipw]
---

# EIP-7199: Linter Scope

> Relax the policy for updating EIP.

**TL;DR:** 一个已撤回的流程提案：修改 EIP 的拉取请求无需修复其未改动行上的 linter 错误，除非它会更改该 EIP 的状态。

## 它解决什么问题？

EIPs 和 ERCs 仓库的每个拉取请求都会由自动 linter（eipw）检查。实际上，linter 会报告文件中的*每一个*错误，包括在拉取请求提交之前很久就已存在的错误。有人只想修正一份大型旧 EIP 里的一个错别字，却可能发现自己这一行的改动被卡住，直到把文档其他地方的格式问题都清理干净。

这种阻力会让人不愿做小而有用的贡献。EIP-7199 提议写下一条明确的规则，让编辑和工具在日常编辑中把此前就已存在的 lint 错误视为可忽略。

## 它如何运作

该提案只有一条政策声明：

- 当拉取请求**更新**现有 EIP 时，不应（SHOULD NOT）要求它修复**未改动行**上的 linter 错误。
- 例外是**状态变更**（例如 Draft 到 Review，或 Last Call 到 Final）。状态变更是对整份文档进行审查的时刻，因此完整的 lint 规则依然适用。

其理由很简单，就是允许"微贡献"：修正错别字、澄清某一节或更新链接，而不会因此变成一次清理工程。

该提案不改变协议、EIP 格式或 lint 规则本身。它只是限定了*哪些*错误应当阻止合并。

## 示例代码

这一想法用伪代码表示，是一个只报告拉取请求所改动行上问题的 linter：

```python
def blocking_errors(pr, lint_errors):
    # A status change gets the full check
    if pr.changes_front_matter_field("status"):
        return lint_errors

    changed = pr.changed_line_numbers()      # lines added or modified in this PR
    return [e for e in lint_errors if e.line in changed]

# Example: a typo fix on line 120 of an old EIP
# lint_errors = [Error(line=12, msg="missing 'description'"),
#                Error(line=120, msg="trailing whitespace")]
# blocking_errors(...) -> only the line-120 error blocks the merge
```

## 需要注意

- **状态：Withdrawn。** 给出的撤回理由是该政策已记录在 [EIP-1](/eip-1/)（EIP 的目的与指南）和 [EIP-5069](/eip-5069/)（EIP 编辑手册）中。当前规则请参阅这两份文档。
- 这是一个关于编辑流程的 Meta EIP，对以太坊客户端、智能合约或钱包没有影响。
- 如果你向 EIP/ERC 仓库贡献内容，请预期 linter 仍会对你的改动运行；对于已存在的问题，编辑会决定执行的严格程度。


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7199
