-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
108 lines (104 loc) · 3.21 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
108 lines (104 loc) · 3.21 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
102
103
104
105
106
107
108
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
#
# Run the same command locally and on CI (see .github/workflows/1_test.yml):
# uv run --no-sync pre-commit run --show-diff-on-failure --color=always --all-files
#
exclude: ^(uv.lock|.vscode/)
default_install_hook_types: [pre-commit, commit-msg]
default_language_version:
python: python3.10
repos:
- repo: local
hooks:
- id: ruff-lint
name: "ruff lint"
entry: uv run ruff check --force-exclude
args: ["--fix", "--exit-non-zero-on-fix", "--preview"]
types_or: [python, pyi]
language: system
- id: ruff-format
name: "ruff format"
entry: uv run ruff format --force-exclude
args: ["--preview"]
types_or: [python, pyi]
language: system
- id: ty-check
name: ty-check
entry: uv run ty check
types_or: [python, pyi]
language: system
pass_filenames: false
- id: deptry
name: deptry
entry: uv run deptry .
language: system
pass_filenames: false
- id: pip-audit
name: pip-audit
entry: uv run pip-audit
language: system
pass_filenames: false
- id: commitizen
name: commitizen check
entry: uv run cz check --allow-abort --commit-msg-file
language: system
stages: [commit-msg]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-illegal-windows-names
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
args: [--assume-in-merge]
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents, --unsafe]
- id: debug-statements
- id: destroyed-symlinks
- id: detect-aws-credentials
- id: detect-private-key
exclude: "(?x)^(
tests/certs/key.key|
tests/certs/ca.key
)$"
- id: end-of-file-fixer
- id: file-contents-sorter
- id: fix-byte-order-marker
- id: forbid-new-submodules
- id: mixed-line-ending
- id: name-tests-test
args: ['--pytest-test-first']
exclude: "(?x)^(
tests/utils.py|
tests/unit/integrations/helpers.py|
tests/integration/checks/httpbin_like_app.py
)$"
- id: no-commit-to-branch
args: [--branch, main]
- id: pretty-format-json
args:
- "--autofix"
- "--indent=4"
- "--no-sort-keys"
- id: requirements-txt-fixer
exclude: ^requirements\.txt$
- id: sort-simple-yaml
- id: trailing-whitespace
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: a1a56a60ddf7e9ba639fdd9f00f852d63ede4c04 # frozen: 0.10.10
hooks:
# Update the uv lockfile
- id: uv-lock
- id: uv-export