-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
142 lines (125 loc) · 4.79 KB
/
.pre-commit-config.yaml
File metadata and controls
142 lines (125 loc) · 4.79 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
minimum_pre_commit_version: 2.10.0
fail_fast: false
repos:
# Git-related
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0 # Use the ref you want to point at
hooks:
- id: forbid-new-submodules
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5 # Use the ref you want to point at
hooks:
- id: git-dirty
# Reformatting (should generally come before any file format or other checks, because reformatting can change things)
- repo: https://github.com/sqlalchemyorg/zimports
rev: 0.2.2 # pick a hash or tag to point to
hooks:
- id: zimports
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0 # Use the ref you want to point at
hooks:
# black and docformatter don't do this in docstrings (11/1/19)
- id: trailing-whitespace
- id: pretty-format-json
args: [--autofix, --no-sort-keys]
# debatable whether this is necessary in Python3 or not
# https://stackoverflow.com/questions/14083111/should-i-use-encoding-declaration-in-python-3
- id: fix-encoding-pragma
- repo: https://github.com/psf/black
rev: 20.8b1 # pick a git hash / tag to point to
hooks:
- id: black
- repo: https://github.com/myint/docformatter
# black seems to be working on formatting docstrings, but use this for now
rev: v1.4 # pick a git hash / tag to point to
hooks:
- id: docformatter
exclude: (tests*)|(exceptions\.py)|(warnings\.py)
# Safety/Security Issues
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.2.1
hooks:
- id: python-safety-dependencies-check
- repo: https://github.com/PyCQA/bandit
rev: 1.7.0
hooks:
- id: bandit
exclude: tests*
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0 # Use the ref you want to point at
hooks:
- id: detect-private-key
# Invalid File Checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0 # Use the ref you want to point at
hooks:
- id: check-added-large-files
args: ['--maxkb=123']
- id: check-json
- id: check-yaml
- id: check-xml
- id: debug-statements
- id: check-merge-conflict
- id: check-case-conflict
# Linting
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812 # pick a git hash / tag to point to
hooks:
- id: mypy
exclude: prerelease.py
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
rev: v1.0.1
hooks:
- id: rst-linter
exclude: docs
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.8.0 # pick a git hash / tag to point to
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4 # pick a git hash / tag to point to
hooks:
- id: flake8
exclude: prerelease.py
- repo: https://github.com/PyCQA/pydocstyle
# black seems to be working on formatting docstrings, but use this for now
rev: 5.1.1 # pick a git hash / tag to point to
hooks:
- id: pydocstyle
args:
# ignore warnings about missing docstrings. pylint takes care of that
# ignore D203 because it's a bug https://github.com/PyCQA/pydocstyle/issues/141
# ignore D407,D408,D409 because they appear to be in conflict with Google style (they relate to underlining?) https://rsmith.home.xs4all.nl/programming/improving-my-python-coding.html
# ignore D406 because it appears to be in conflict with Google style (complains about 'Raises:')
# ignore D413 about final blank line because docformatter gets rid of it
# ignore D213 because mutually exclusive with D212 https://stackoverflow.com/questions/45990301/pep257-d212-and-d213-conflicts
- --ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D407,D408,D409,D406,D413,D213
exclude: prerelease.py
- repo: https://github.com/NanoSurface-Biomedical/pre-commit-pylint
rev: "5a76725fa664ca733db485598da5c8460cf3347f" # pick a git hash / tag to point to
hooks:
- id: pylint-pass-with-displayed-warnings
name: pylint-src
args:
- --codes-to-allow=W0511
- src
- --rcfile=src/pylintrc
- --ignore-patterns=.*~.*
- --jobs 0
files: ('src/.*\.py$')|(prerelease.py)
exclude: '.*\~.*'
verbose: true
- id: pylint-pass-with-displayed-warnings
name: pylint-tests
args:
- --codes-to-allow=W0511
- tests
- --rcfile=tests/pylintrc
- --ignore-patterns=.*~.*
- --jobs 0
files: 'tests/.*\.py$'
exclude: ('.*\~.*')|(prerelease.py)
verbose: true
- id: python-check-no-print-statments
exclude: prerelease.py