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.
This commit is contained in:
Daniel Han 2026-03-22 03:25:58 -07:00 committed by GitHub
parent 17dc83dc34
commit bcf28466c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,6 +6,7 @@ repos:
args:
- --fix
- --exit-non-zero-on-fix
exclude: '\.ipynb$'
- repo: local
hooks:
- id: ruff-format-with-kwargs