-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
89 lines (87 loc) · 2.44 KB
/
.pre-commit-config.yaml
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
---
default_language_version:
python: python3.12
default_install_hook_types: [pre-commit, commit-msg]
repos:
- repo: local
hooks:
- id: conventional-pre-commit
name: Lint commit messages
entry: conventional-pre-commit
language: python
stages: [commit-msg]
- id: trailing-whitespace
stages: [pre-commit]
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
language: python
types: [text]
- id: end-of-file-fixer
stages: [pre-commit]
name: Add a blank line at end of a file
entry: end-of-file-fixer
language: python
types: [text]
- id: mixed-line-ending
stages: [pre-commit]
name: Ensure line feed character (LF)
entry: mixed-line-ending
language: python
types: [text]
args: [--fix=lf]
- id: add-trailing-comma
stages: [pre-commit]
name: Add trailing commas
entry: add-trailing-comma
language: python
types: [python]
- id: check-ast
stages: [pre-commit]
name: Check that files parse as valid python
entry: check-ast
language: python
types: [python]
- id: check-yaml
stages: [pre-commit]
name: Check yaml
entry: check-yaml
language: python
types: [yaml]
args: [--unsafe]
# Formatters should be run late so that they can re-format
# any prior changes
- id: ruff
stages: [pre-commit]
name: Formatting with ruff
entry: ruff
language: python
args: [format]
types: [python]
- id: isort
stages: [pre-commit]
name: Ensure imports are grouped and sorted
entry: isort
language: python
types: [python]
args: [--check, --diff, --profile=black]
- id: yamllint
stages: [pre-commit]
name: Lint yaml files
entry: yamllint
language: python
types: [yaml]
- id: ruff
stages: [pre-commit]
name: Lint with ruff
entry: ruff
language: python
args: [check, --fix, --config, ./pyproject.toml]
types: [python]
- id: mypy
stages: [pre-commit]
name: Type checking with mypy
additional_dependencies: [types-PyYAML]
entry: mypy
language: python
types: [python]
args: [--config-file=./pyproject.toml]