-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.pre-commit-config.yaml
59 lines (45 loc) · 1.51 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
# This is for the "pre-commit" tool, which enforces checks before local commits are allowed.
# <https://pre-commit.com/>
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
# Trims trailing whitespace.
- id: trailing-whitespace
# Prevent giant files from being committed.
- id: check-added-large-files
# Simply check whether files parse as valid python.
- id: check-ast
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# Attempts to load all xml files to verify syntax.
- id: check-xml
# Attempts to load all yaml files to verify syntax.
- id: check-yaml
# Check for debugger imports and py37+ breakpoint() calls in python source.
- id: debug-statements
# Makes sure files end in a newline and only a newline.
- id: end-of-file-fixer
# Sorts entries in requirements.txt and removes incorrect entry for pkg-resources==0.0.0
- id: requirements-txt-fixer
# Replaces or checks mixed line ending.
- id: mixed-line-ending
args: [--fix=no]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
# Format YAML files.
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.5.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2']
# Type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
hooks:
- id: mypy
args: [--install-types, --non-interactive]