-
Notifications
You must be signed in to change notification settings - Fork 42
/
.pre-commit-config.yaml
166 lines (165 loc) · 4.78 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Skip execution of one or more hooks using the SKIP environment variable:
# $ SKIP=pylint git commit -m "foo"
# $ SKIP=mypy,pylint pre-commit run --all-files
#
# If want to disable all hooks while committing, use the --no-verify/-n option:
# $ git commit -n -m "foo"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-case-conflict
# - id: check-executables-have-shebangs
# - id: check-shebang-scripts-are-executable
# - id: fix-byte-order-marker
# - id: fix-encoding-pragma
- id: check-yaml
- id: check-json
# - id: pretty-format-json
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: detect-private-key
- id: debug-statements
- id: requirements-txt-fixer
- id: check-docstring-first
# - id: name-tests-test
- id: check-toml
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.8.1
hooks:
- id: markdownlint-cli2-fix
name: markdownlint-cli2-fix (in place fixes)
- repo: https://github.com/leoll2/copyright_notice_precommit
rev: 0.1.1
hooks:
- id: copyright-notice
args: [--notice=COPYRIGHT]
files: python
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.0
hooks:
- id: autoflake
args:
- --in-place
- --expand-star-imports
- --remove-all-unused-imports
- --ignore-init-module-imports
- --remove-duplicate-keys
- --remove-unused-variables
- --remove-rhs-for-unused-variables
language: python
types: [python]
- repo: https://github.com/asottile/pyupgrade
rev: v3.9.0
hooks:
- id: pyupgrade
args: [--py38-plus]
# exclude: *fixtures
language: python
types: [python]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (black profile, in place fixes)
args: ["--profile", "black", "--filter-files"]
language: python
types: [python]
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
description: "Formats docstrings to follow PEP 257."
language: python
types: [python]
args: ["--in-place"]
- repo: https://github.com/DanielNoord/pydocstringformatter
rev: v0.7.3
hooks:
- id: pydocstringformatter
language: python
types: [python]
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
additional_dependencies: [tomli]
language: python
types: [python]
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
language: python
types: [python]
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
language: python
types: [python]
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
name: black (in place fixes)
# args: [--diff, --check]
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
# language_version: python3.11
language: python
types: [python]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
name: bandit (btclib)
args: []
exclude: test_*
language: python
types: [python]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
name: bandit (tests)
# for the test folder disable
# B101, Test for use of assert
# B311, Standard pseudo-random generators are not suitable
# for security/cryptographic purposes
args: ["--skip", "B101,B311"]
exclude: btclib
language: python
types: [python]
- repo: https://github.com/PyCQA/pylint
rev: v3.0.0a6
hooks:
- id: pylint
args: [
"--disable=E0401", # import-error
]
language: python
types: [python]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
hooks:
- id: mypy
language: python
types: [python]
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
description: Check the completeness of MANIFEST.in for Python packages.
language: python
pass_filenames: false
always_run: true
- repo: https://github.com/regebro/pyroma
rev: "4.2"
hooks:
- id: pyroma