unsloth/.pre-commit-config.yaml
Daniel Han bcf28466c2
fix: exclude .ipynb from ruff pre-commit hook (#4521)
The ruff pre-commit hook runs on all file types by default, including
.ipynb notebooks. Colab notebooks are authored in Colab's editor and
can contain IPython magics (%cd, !git) that ruff cannot parse. This
causes pre-commit.ci to fail on unrelated PRs when a notebook on main
has syntax ruff does not understand.

Add `exclude: '\.ipynb$'` to the ruff hook so notebooks are skipped.
2026-03-22 03:25:58 -07:00

18 lines
458 B
YAML

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.6
hooks:
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
exclude: '\.ipynb$'
- repo: local
hooks:
- id: ruff-format-with-kwargs
name: Ruff format with kwarg spacing
entry: scripts/run_ruff_format.py
language: python
types: [python]
additional_dependencies:
- ruff==0.6.9