repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.12.5"
hooks:
- id: ruff-format
- id: ruff
args: [--fix]
- repo: local
hooks:
- id: clean-notebooks
name: clean-notebooks
files: \.ipynb$
exclude: ^tutorials/evals/.*\.ipynb$
stages: [pre-commit]
language: system
entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --ClearMetadataPreprocessor.enabled=True --inplace
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.1
hooks:
- id: nbqa-ruff
name: format-notebooks
files: \.ipynb$
stages: [pre-commit]
args: ["--fix", "--ignore=E402", "--ignore=E501", "--ignore=F704"]
- repo: local
hooks:
- id: oxfmt-app
name: oxfmt (app)
entry: pnpm --dir app run fmt:check
language: system
files: ^app/.*\.(jsx?|tsx?|css|md|json|ya?ml)$
pass_filenames: false
- id: oxfmt-js
name: oxfmt (js)
entry: pnpm --dir js run fmt:check
language: system
files: ^js/.*\.(jsx?|tsx?|md|json|ya?ml)$
pass_filenames: false
- repo: https://github.com/pre-commit/mirrors-eslint
rev: "8ddcbd412c0b348841f0f82c837702f432539652"
hooks:
- id: eslint
files: \.[jt]sx?$
types: [file]
args: ["-c", "app/eslint.config.mts"]
additional_dependencies:
- eslint@9.39.1
- eslint-plugin-react@7.37.5
- eslint-plugin-react-hooks@7.0.1
- typescript-eslint@8.46.3
- typescript@5.4.5
- jiti@2.6.1
- repo: local
hooks:
- id: forbid-commit-to-local-main-branch
name: Check branch before committing
entry: bash -c '[[ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]] || { echo "Should not commit to local main branch."; exit 1; }'
language: system
stages: [pre-commit]
- id: uv-lock-check
name: uv lock --check
entry: uv lock --check
language: system
files: (pyproject\.toml$|^uv\.lock$)
pass_filenames: false
stages: [pre-commit]