mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-09-28 21:45:27 +08:00
docs(skill): recommend ruff --fix workflow for PRs failing ruff check (#15218)
* docs(skill): recommend ruff --fix then --unsafe-fixes for PRs failing ruff check * Update .github/skills/code-review/SKILL.md --------- Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
co-authored by
Christian Clauss
parent
ece9b395b8
commit
ca133c7b2c
@@ -33,6 +33,24 @@ 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., `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
|
||||
|
||||
- [ ] At least one **Wikipedia (or equivalent) URL** documenting the algorithm.
|
||||
|
||||
Reference in New Issue
Block a user