From bcf28466c244b5c1322b3d6013adf10b05afa4fc Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sun, 22 Mar 2026 03:25:58 -0700 Subject: [PATCH] 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. --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fafd6b3daa..1879186a73 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,6 +6,7 @@ repos: args: - --fix - --exit-non-zero-on-fix + exclude: '\.ipynb$' - repo: local hooks: - id: ruff-format-with-kwargs