mirror of
https://github.com/huggingface/peft.git
synced 2025-10-20 15:33:48 +08:00
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.
14 lines
303 B
YAML
14 lines
303 B
YAML
repos:
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.12.8
|
|
hooks:
|
|
- id: ruff
|
|
args:
|
|
- --fix
|
|
- id: ruff-format
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.6.0
|
|
hooks:
|
|
- id: check-merge-conflict
|
|
- id: check-yaml
|