forked from BenWhetton/keras-surgeon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
82 lines (72 loc) · 1.88 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
default_stages:
- commit
repos:
# general file format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
# markdown formatting
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
hooks:
- id: mdformat
# Optionally add plugins
additional_dependencies:
- mdformat-gfm
- mdformat-black
# automatically upgrade python code for newer versions
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py310-plus]
# remove unused python imports
- repo: https://github.com/myint/autoflake
rev: v2.0.0
hooks:
- id: autoflake
args: [ --in-place, --remove-all-unused-imports ]
# turn relative imports into absolute ones
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
# sort python imports
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- id: isort
name: isort (cython)
types: [ cython ]
- id: isort
name: isort (pyi)
types: [ pyi ]
# format python code
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
args: [ --line-length=100, -S ]
# python lint
- repo: https://github.com/pycqa/pylint
rev: v2.16.0b1
hooks:
- id: pylint
# type checks
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
hooks:
- id: mypy
additional_dependencies: [ numpy==1.23.0, types-all ]
exclude: .*\.pyi$
# python style
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8