PyCQA/flake8 at 01b9726 · static read-only analysis · why-not-rust method 2.0PyCQA/flake8 @ 01b9726 · 只读静态分析 · why-not-rust method 2.0
Repository: github.com/PyCQA/flake8 at commit 01b9726, shallow clone. Scope: the whole repository, with the orchestrator in src/ as the migration candidate. Sampling: 4,741 lines across 33 files in src/, 4,802 lines of tests, and packaging metadata from setup.cfg. install_requires names mccabe, pycodestyle and pyflakes; [options.entry_points] at setup.cfg:40 declares the flake8.extension and flake8.report tables. The three checker packages are separate distributions and were not cloned or measured. No build, test, benchmark or network call was run against the project. Objective: cut Python lint wall-clock by roughly an order of magnitude. User-supplied facts: none. Amdahl inputs: share=0.30, kernel speedup=infinite, boundary=0, target=10 → end-to-end 1.4285714285714286x, infinite-kernel ceiling 1.4285714285714286x, target physically IMPOSSIBLE. The 30% share is an explicit upper-bound assumption chosen to favour the rewrite option; it is not a profile. Gates 1 and 2 pass, gates 3 and 4 fail. So a performance requirement that clears the first two gates still yields REJECT: the cheapest option that meets it is adopting a tool that already exists. This is a structured decision protocol, not a statistical predictor.仓库:github.com/PyCQA/flake8,commit 01b9726,shallow clone。范围:整个仓库,其中 src/ 里的编排器是迁移候选。取样:src/ 下 33 个文件共 4,741 行,测试 4,802 行,以及 setup.cfg 里的打包元数据。install_requires 列出 mccabe、pycodestyle、pyflakes;setup.cfg:40 的 [options.entry_points] 声明了 flake8.extension 和 flake8.report 两张表。三个 checker 包是独立的发行物,没有克隆,也没有测量。没有对项目执行任何构建、测试、基准或网络调用。目标:把 Python lint 的墙钟时间压掉约一个数量级。用户提供的事实:无。Amdahl 输入:share=0.30, kernel speedup=infinite, boundary=0, target=10 → end-to-end 1.4285714285714286x, infinite-kernel ceiling 1.4285714285714286x, target physically IMPOSSIBLE。30% 这个份额是为了照顾重写方案而显式选取的上界,不是 profile 结果。G1、G2 通过,G3、G4 未通过。所以一个能过前两道门的性能需求,最终仍然是 REJECT:满足它的最便宜方案,是采用一个已经存在的工具。这是一套结构化决策协议,不是统计预测器。
| What we don't know证据缺口 | What it would change会改变什么 |
| A profile of flake8's own orchestration shareflake8 自身编排份额的 profile | The 30% figure is a generous assumption, not a measurement. An actual profile would either reopen D2 with defensible inputs or confirm the time sits in the three checker packages.30% 是一个宽松的假设,不是实测。真跑一次 profile,要么用站得住的输入重开 D2,要么确认时间就在那三个 checker 包里。 |
| Rule-coverage mapping for the adopting team采用方团队的规则覆盖映射 | Adoption's actual cost is which rules do not map. Until that list exists, the selected option's compatibility risk is unquantified for any specific project.采用的真实成本在于哪些规则映射不过去。这份清单出来之前,对任何具体项目来说,所选方案的兼容风险都没有量化。 |
| An independent benchmark of flake8 versus the native linterflake8 与原生 linter 的独立基准测试 | Current figures are adopter-reported for the competing tool. An independent same-corpus comparison would firm up D1's strength.现在这些数字来自采用方对竞品工具的报告。一次同语料的独立对比可以坐实 D1 的证据强度。 |