-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
69 lines (59 loc) · 2.77 KB
/
.pre-commit-config.yaml
File metadata and controls
69 lines (59 loc) · 2.77 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
default_language_version:
python: python3.13
default_stages: [pre-commit]
exclude: "notebooks/"
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
- id: ruff # Unsafe fixes can be applied with pre-commit run --hook-stage manual ruff
args:
- --unsafe-fixes
stages: [manual]
types_or: [python, pyi, jupyter]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: debug-statements
- id: requirements-txt-fixer # order requirements alphabetically
- id: check-ast # Simply check whether the files parse as valid python
- id: check-case-conflict # Check for files that would conflict in case-insensitive filesystems
- id: check-builtin-literals # Require literal syntax when initializing empty or zero Python builtin types
- id: check-docstring-first # Check a common error of defining a docstring after code
- id: check-merge-conflict # Check for files that contain merge conflict strings
- id: check-yaml # Check yaml files
args: ["--unsafe"]
exclude: "^app/deployment/charts/"
- id: end-of-file-fixer # Ensure that a file is either empty, or ends with one newline
- id: mixed-line-ending # Replace or checks mixed line ending
- id: trailing-whitespace # This hook trims trailing whitespace
- id: check-toml # Attempts to load all TOML files to verify syntax.
- id: check-json # Attempts to load all json files to verify syntax.
- id: detect-private-key # Checks for the existence of private keys.
- id: check-added-large-files # Check if any large file is added
- repo: local
# We do not use pre-commit/mirrors-mypy, as it comes with opinionated defaults (like --ignore-missing-imports)
# and is difficult to configure to run with the dependencies correctly installed
# cf. https://jaredkhan.com/blog/mypy-pre-commit
hooks:
- id: mypy
name: mypy
entry: "uv run --extra lint mypy src/ tests/ --config-file pyproject.toml"
language: system # Run the hook in the system environment and do not re-create a virtual environment
types: [python] # Trigger hook only for commits updating Python files
require_serial: true # Use require_serial so that script is only called once per commit
pass_filenames: false # Do no pass filenames to the entry command
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v1.2.0
hooks:
- id: conventional-pre-commit
stages:
- commit-msg
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.20
hooks:
- id: uv-lock