mirror of
https://github.com/huggingface/peft.git
synced 2025-10-20 15:33:48 +08:00
CHORE: Upgrade ruff to ~0.12.8 (#2734)
Subjectively, there have been more issues recently with contributor PRs being rejected by ruff. This could possibly be caused by them using a different ruff version (presumably: more recent). This PR upgrades ruff to the latest version to hopefully reduce these issues. The only change needed to make this ruff version pass was to disable UP045. This rule requires changing code like: x: Optional[int] into x: int | None in 220 places. Personally, I don't think it's crucial. Moreover, ruff won't fix this automically, except with --unsafe-fixes (note that Python 3.9 needs a __future__ import for this, so that could be the reason). My preference is thus just to disable the rule, but LMK if you disagree.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.9.2
|
||||
rev: v0.12.8
|
||||
hooks:
|
||||
- id: ruff
|
||||
args:
|
||||
|
@ -27,6 +27,7 @@ ignore = [
|
||||
"F841", # unused variable
|
||||
"UP007", # X | Y style Unions
|
||||
"C420", # dict.fromkeys
|
||||
"UP045", # don't force replacing Optional[X] with X | None
|
||||
]
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
|
2
setup.py
2
setup.py
@ -21,7 +21,7 @@ extras = {}
|
||||
extras["quality"] = [
|
||||
"black", # doc-builder has an implicit dependency on Black, see huggingface/doc-builder#434
|
||||
"hf-doc-builder",
|
||||
"ruff~=0.9.2",
|
||||
"ruff~=0.12.8",
|
||||
]
|
||||
extras["docs_specific"] = [
|
||||
"black", # doc-builder has an implicit dependency on Black, see huggingface/doc-builder#434
|
||||
|
Reference in New Issue
Block a user