-
Notifications
You must be signed in to change notification settings - Fork 4
/
.pre-commit-config.yaml
50 lines (46 loc) · 1.43 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
repos:
# Syntax validation and some basic sanity checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-merge-conflict
- id: check-ast
fail_fast: True
- id: check-json
- id: check-added-large-files
args: ['--maxkb=200']
- id: check-yaml
# Automatically sort imports
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort
args: [
'-a', 'from __future__ import annotations', # 3.7-3.11
'--rm', 'from __future__ import absolute_import', # -3.0
'--rm', 'from __future__ import division', # -3.0
'--rm', 'from __future__ import generator_stop', # -3.7
'--rm', 'from __future__ import generators', # -2.3
'--rm', 'from __future__ import nested_scopes', # -2.2
'--rm', 'from __future__ import print_function', # -3.0
'--rm', 'from __future__ import unicode_literals', # -3.0
'--rm', 'from __future__ import with_statement', # -2.6
]
# Automatic source code formatting
- repo: https://github.com/psf/black
rev: 21.6b0
hooks:
- id: black
args: [--safe, --quiet]
# Linting
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: ['flake8-comprehensions==3.5.0']
# Type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
hooks:
- id: mypy
files: 'src/.*\.py$'