-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
101 lines (90 loc) · 3.18 KB
/
.pre-commit-config.yaml
File metadata and controls
101 lines (90 loc) · 3.18 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
minimum_pre_commit_version: 3.8.0
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.15.0
hooks:
- id: pretty-format-toml
args: [--autofix, --indent, "2"]
exclude: tach.toml|uv.lock
- id: pretty-format-yaml
args: [--autofix, --preserve-quotes, --indent, "2", --offset, "2"]
- repo: https://github.com/hukkin/mdformat
rev: 0.7.22
hooks:
- id: mdformat
additional_dependencies:
- mdformat-frontmatter
- mdformat-gfm
- mdformat-gfm-alerts
- mdformat-myst
- mdformat-ruff
- mdformat-tables
args: [--number]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
types: [python]
args: [--comment-style, "|#|", --license-filepath, ./HEADER.txt, --fuzzy-match-generates-todo]
# The following hooks use development tools which are already managed by 'uv'.
# To avoid inconsistencies between the development and the pre-commit
# environments, we run them as local hooks so we can make sure they use
# exactly the same versions without duplicating the version info.
- repo: local
hooks:
- &uv-managed-hook
id: uv-managed-base-hook
name: uv managed hook
entry: uv --version
language: python
additional_dependencies: [uv>=0.6.10]
stages: [pre-commit]
- <<: *uv-managed-hook
id: uv-lock
name: uv-lock
description: "Automatically run 'uv lock' on your project dependencies"
entry: uv lock
files: ^(uv\.lock|pyproject\.toml|uv\.toml)$
pass_filenames: false
- <<: *uv-managed-hook
id: ruff-check
name: ruff checker
entry: uv run --group dev --frozen --isolated ruff check --force-exclude --fix
types_or: [python, pyi, jupyter]
exclude: "^(tests/|docs/|examples/)" # TODO(egparedes): remove the exclusions
require_serial: true
- <<: *uv-managed-hook
id: ruff-format
name: ruff formatter
entry: uv run --group dev --frozen --isolated ruff format --force-exclude
types_or: [python, pyi, jupyter]
require_serial: true
- <<: *uv-managed-hook
id: tach
name: tach module dependency checker
entry: uv run --group dev --frozen --isolated tach check
pass_filenames: false
- <<: *uv-managed-hook
id: mypy
name: mypy static type checker
entry: uv run --group dev --frozen --isolated mypy --no-install-types src/
types_or: [python, pyi]
pass_filenames: false
- <<: *uv-managed-hook
id: validate
name: validate pyproject.toml
entry: uv run --group dev --frozen --isolated validate-pyproject pyproject.toml
files: ^pyproject\.toml$
pass_filenames: false