From e698ef8bfaa8f5e6918f5473e8ba9fec4b11b58a Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Wed, 5 Aug 2026 04:09:21 -0600 Subject: [PATCH] =?UTF-8?q?docs:=20=E7=BA=A6=E6=9D=9F=20ruff=20format=20?= =?UTF-8?q?=E5=8F=AA=E4=BD=9C=E7=94=A8=E4=BA=8E=E4=BB=BB=E5=8A=A1=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ruff format . 会重排 50+ 个历史遗留格式的无关文件。 Co-Authored-By: Claude Sonnet 5 --- docs/superpowers/plans/2026-08-05-problem-tag-refactor.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/superpowers/plans/2026-08-05-problem-tag-refactor.md b/docs/superpowers/plans/2026-08-05-problem-tag-refactor.md index 33945a4..351a585 100644 --- a/docs/superpowers/plans/2026-08-05-problem-tag-refactor.md +++ b/docs/superpowers/plans/2026-08-05-problem-tag-refactor.md @@ -16,7 +16,9 @@ - **本次不跑数据库、不开浏览器。**(用户 2026-08-05 决定)`oj/dev_settings.py:6-14` 指向的是远程库 `150.158.29.156:5455`,不是本地库;本次只写代码,运行时验证由用户自己择机进行。因此: - **不要执行任何 `manage.py` 命令**(`migrate` / `makemigrations` / `shell` / `showmigrations` 都会连远程库,而且可能长时间挂起)。迁移文件按计划给出的内容**手写**。 - **不要执行任何写数据的操作**,也不要造测试数据。 - - 后端每个任务的验证 = `ruff format .` + `ruff check .` 通过;前端 = `npm fmt` + `npm run build` 通过。 + - 后端每个任务的验证 = `ruff format <本任务改动的文件>` + `ruff check .` 通过;前端 = `npm fmt` + `npm run build` 通过。 +- **`ruff format` 只格式化本任务改动的文件,不要跑 `ruff format .`。** 仓库里有 50 多个文件不符合当前 ruff 版本的格式化结果,`ruff format .` 会把它们全部重排,污染工作区。`ruff check .` 可以全仓库跑(只读)。 +- **提交前必须确认 `git status` 只包含本任务的文件。** 有多余文件就 `git checkout -- <那些文件>` 还原,绝不要把无关改动一起提交。 - 计划各任务里凡是标注「**[本次跳过]**」的步骤,一律不执行,直接跳到下一步。 - 后端仓库 `OnlineJudge/`,前端仓库 `ojnext/`,**两者是独立的 git 仓库**,根目录 `OJ/` 不是仓库。跨仓库任务分别提交。后端当前分支 `yuetsh`,前端当前分支 `main`。 - 后端 lint:`ruff check .` 与 `ruff format .`(E/F/I 规则,行宽 180,双引号)。每次提交前必须通过。