-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
37 lines (34 loc) · 1.22 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
37 lines (34 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
default_install_hook_types: [pre-commit, pre-push]
repos:
- repo: local
hooks:
- id: ruff
name: ruff
entry: bash -c '
base=$(git rev-parse --verify --quiet origin/main || git rev-parse --verify --quiet main) &&
files=$(git diff --name-only --diff-filter=ACMR "$base"...HEAD -- "*.py" "*.ipynb") &&
if [ -z "$files" ]; then
echo "ruff - no changed files to check";
else
uv run ruff check --force-exclude --config lint.per-file-ignores={} $files &&
uv run ruff format --check --diff --force-exclude $files;
fi'
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: pytest
name: pytest
entry: uv run pytest
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: doctest
name: doctest
entry: bash -c 'uv run --directory docs sphinx-autogen -o library/generated library/api.md &&
uv run --directory docs jb build . --builder=custom --custom-builder=doctest'
language: system
pass_filenames: false
always_run: true
stages: [pre-push]