-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
98 lines (76 loc) · 2.75 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
90
91
92
93
94
95
96
97
98
default_language_version:
python: python3.10
repos:
# Black is a Python code formatter and ensures that our code is consistently formatted.
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
args: [
--skip-string-normalization, # black is opinionated towards "" strings by default, skip that check
--line-length=120
]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: [
--settings-path=pyproject.toml
]
# Some out-of-the-box hooks for pre-commit
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
# Simply check whether files parse as valid python.
- id: check-ast
# Checks for a common error of placing code before the docstring.
- id: check-docstring-first
# Check for debugger imports and py37+ breakpoint() calls in python source.
- id: debug-statements
# Checks for the existence of private keys.
- id: detect-private-key
# Prevent addition of new git submodules.
- id: forbid-new-submodules
# Replaces or checks mixed line ending.
- id: mixed-line-ending
# Trims trailing whitespace.
- id: trailing-whitespace
# Makes sure files end in a newline and only a newline.
- id: end-of-file-fixer
# Assert that files in tests/ match test*.py.
- id: name-tests-test
args: [--django]
exclude: ^tests/test_utils/.*$
# Prevent giant files from being committed (default=500kB).
- id: check-added-large-files
# Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT.
- id: check-case-conflict
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# Checks for symlinks which do not point to anything.
- id: check-symlinks
# Replaces double quoted strings with single quoted strings.
- id: double-quote-string-fixer
# Attempts to load all json files to verify syntax.
- id: check-json
# Checks that all your JSON files are "pretty".
- id: pretty-format-json
args: [
--autofix,
--no-sort-keys,
--no-ensure-ascii
]
# Attempts to load all yaml files to verify syntax.
- id: check-yaml
# Sorts simple YAML files which consist only of top-level keys, preserving comments and blocks.
- id: sort-simple-yaml
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
# Run flake8 on python files.
- id: flake8
args: [
--max-line-length=120,
--max-complexity=18,
--ignore=**/settings/*.py F401 F403 F405
]