[moz] ci(lint): 锁定 flake8==7.3.0,修复版本漂移致 E122 全线误报
CI / lint (pull_request) Failing after 18s
CI / test (pull_request) Has been skipped
CI / frontend (pull_request) Has been skipped
CI / notify-on-failure (pull_request) Successful in 10s

根因:ci.yml lint 步骤 pip install flake8 未锁版本,runner 每次装最新版。
2026-09-11 新版 pycodestyle 对 main 现存代码(toolchain_routes.py:1217)报
E122,而该代码 2026-06-23 后未改动、06-25 CI 绿——纯工具版本漂移,main
全量 lint 现已必红,阻塞所有 PR(含挂起 9 天的 #131)。

证据:本地 flake8 7.3.0 (pycodestyle 2.14.0) 对 origin/main 全量 src/
零报错(exit=0);CI 同款命令最新版报 1217:21 E122。

处置:锁定 7.3.0(实证绿版本),版本策略写入 ci.yml 行内注释。
纯 CI 配置变更,不碰业务代码。

交付检查:
- docs/design:无需更新(设计文档未规定 flake8 版本策略,ci.yml 注释即现行说明)
- tests:无需更新(纯 CI 配置,本 PR 自身 CI 即验证)
This commit is contained in:
2026-09-11 05:19:29 +08:00
parent 89bbfeb54a
commit 19a76e25d6
+1 -1
View File
@@ -34,7 +34,7 @@ jobs:
rm -rf /tmp/ci-venv-lint
python3 -m venv /tmp/ci-venv-lint
/tmp/ci-venv-lint/bin/pip install --quiet --upgrade pip
/tmp/ci-venv-lint/bin/pip install --quiet flake8
/tmp/ci-venv-lint/bin/pip install --quiet 'flake8==7.3.0' # 锁版本:防漂移。2026-09-11 新版 pycodestyle 对现存代码报 E122 致 lint 全线误报,7.3.0 经全量 src/ 实证零报错
- name: Lint with flake8
run: |