forked from docling-project/docling
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
65 lines (65 loc) · 2.27 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
65 lines (65 loc) · 2.27 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
fail_fast: true
default_stages: [pre-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
files: '^(docling|docs/examples|tests)/.*\.py$|^(\.pre-commit-config\.yaml|pyproject\.toml|tach\.toml)$'
- id: end-of-file-fixer
files: '^(docling|docs/examples|tests)/.*\.py$|^(\.pre-commit-config\.yaml|pyproject\.toml|tach\.toml)$'
- id: check-yaml
args: [--unsafe]
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
args: [--maxkb=5120]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
hooks:
# Run the Ruff formatter.
- id: ruff-format
name: "Ruff formatter"
args: [--config=pyproject.toml]
files: '^(docling|tests|docs/examples).*\.(py|ipynb)$'
# Run the Ruff linter.
- id: ruff
name: "Ruff linter"
args: [--exit-non-zero-on-fix, --fix, --config=pyproject.toml]
files: '^(docling|tests|docs/examples).*\.(py|ipynb)$'
- repo: local
hooks:
- id: ty
name: ty
entry: uv run --no-sync ty check
language: system
files: '^(docling|\.github/scripts)/.*\.py$'
- id: tach
name: Tach
entry: uv run --no-sync tach check
pass_filenames: false
language: system
files: '^docling/.*\.py$|^tach\.toml$'
- id: tach-module-coverage
name: Tach module coverage
entry: python3 scripts/check_tach_module_coverage.py
pass_filenames: false
language: system
files: '^docling/.*\.py$|^tach\.toml$|^scripts/check_tach_module_coverage\.py$'
- id: max-lines
name: Check max lines per file
entry: python3 scripts/check_max_lines.py
args: [--max-lines=1500]
language: system
files: '\.(py|ts|tsx|js|jsx|rs|json|sql|md|txt|yaml|yml)$'
pass_filenames: true
- id: dprint
name: Dprint check
entry: uv run --no-sync dprint check --config .github/dprint.json --config-discovery=false
pass_filenames: false
language: system
files: '^(\.github/dprint\.json|tach\.toml)$'
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.8.3
hooks:
- id: uv-lock