From f46b2a4a2c7f9b8ad92e8e58b57598389e3b653c Mon Sep 17 00:00:00 2001 From: priya-sundaram-dev Date: Mon, 7 Sep 2026 05:39:14 +0000 Subject: [PATCH 1/2] docs(skill): recommend ruff --fix then --unsafe-fixes for PRs failing ruff check --- .github/skills/code-review/SKILL.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/skills/code-review/SKILL.md b/.github/skills/code-review/SKILL.md index 170b3f598576..cd669f66fdbc 100644 --- a/.github/skills/code-review/SKILL.md +++ b/.github/skills/code-review/SKILL.md @@ -33,6 +33,23 @@ suggest the fix — never just "rejected". - [ ] Descriptive variable and function names (no single letters where a word helps). - [ ] Code is formatted and lint-clean (`ruff`, `pre-commit`). +#### When a PR fails `ruff check` + +Don't just report the failure — try the mechanical fixes and recommend the one +that works, in this order: + +1. Run `ruff check --fix file_path.py`. If that makes the file pass, recommend + that solution — these are the fixes `ruff` considers **safe**. +2. If it still fails, run `ruff check --fix --unsafe-fixes file_path.py`. If that + makes the file pass **and** the resulting diff is genuinely safe (it preserves + behavior — review it, don't trust it blindly), recommend that solution and note + that it required `--unsafe-fixes`. +3. If neither passes, or the unsafe fix would change behavior, describe the + remaining rule violations and the manual change the author needs to make. + +Always quote the exact rule code(s) `ruff` reports (e.g. `UP047`, `RUF100`) so the +author knows what is being flagged, and paste the concrete command you ran. + ### 3. Other Requirements for Submissions - [ ] At least one **Wikipedia (or equivalent) URL** documenting the algorithm. From c5a90f14ddfd7c57104a7e3d21f5ac28d448f652 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 7 Sep 2026 07:48:12 +0200 Subject: [PATCH 2/2] Update .github/skills/code-review/SKILL.md --- .github/skills/code-review/SKILL.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/skills/code-review/SKILL.md b/.github/skills/code-review/SKILL.md index cd669f66fdbc..31725125cb84 100644 --- a/.github/skills/code-review/SKILL.md +++ b/.github/skills/code-review/SKILL.md @@ -47,8 +47,9 @@ that works, in this order: 3. If neither passes, or the unsafe fix would change behavior, describe the remaining rule violations and the manual change the author needs to make. -Always quote the exact rule code(s) `ruff` reports (e.g. `UP047`, `RUF100`) so the -author knows what is being flagged, and paste the concrete command you ran. +Always quote the exact rule code(s) `ruff` reports (e.g., `ruff rule UP047`, +`ruff rule RUF100`) so the author can run those commands to read the rules being +flagged. Also, paste the concrete command you ran. ### 3. Other Requirements for Submissions