-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
94 lines (85 loc) · 2.97 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
---
minimum_pre_commit_version: 2.10.1
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-merge-conflict
description: Check for files that contain merge conflict strings.
language_version: python3
- id: trailing-whitespace
description: Trims trailing whitespace.
args: [--markdown-linebreak-ext=md]
language_version: python3
- id: mixed-line-ending
description: Replaces or checks mixed line ending.
args: [--fix=lf]
exclude: make.bat
language_version: python3
- id: fix-byte-order-marker
description: Removes UTF-8 BOM if present, generally a Windows problem.
language_version: python3
- id: end-of-file-fixer
description: Makes sure files end in a newline and only a newline.
exclude: tests/fake_.*\.key
language_version: python3
- id: check-ast
description: Simply check whether files parse as valid python.
language_version: python3
- id: check-yaml
- id: check-json
# ----- Formatting ---------------------------------------------------------------------------->
- repo: https://github.com/myint/autoflake
rev: v1.7.4
hooks:
- id: autoflake
name: Remove unused variables and imports
language: python
args: ["--in-place", "--remove-all-unused-imports", "--remove-unused-variables", "--expand-star-imports"]
files: \.py$
- repo: https://github.com/saltstack/pre-commit-remove-import-headers
rev: 1.1.0
hooks:
- id: remove-import-headers
- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
hooks:
- id: pyupgrade
name: Rewrite Code to be Py3.10+
args: [--py310-plus]
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.8.4
hooks:
- id: reorder-python-imports
args: [--py310-plus]
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
args: []
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
additional_dependencies: [black==22.10.0]
- repo: https://github.com/myint/rstcheck
rev: v6.1.0
hooks:
- id: rstcheck
name: Check reST files using rstcheck
args: [--report-level=warning]
additional_dependencies: [sphinx]
# <---- Formatting -----------------------------------------------------------------------------
# ----- Security -------------------------------------------------------------------------------------------------->
- repo: https://github.com/PyCQA/bandit
rev: "1.7.4"
hooks:
- id: bandit
name: Run bandit against POP project
args: [--silent, -lll]
files: .*\.py
exclude: >
(?x)^(
tests/.*
)$
# <---- Security ---------------------------------------------------------------------------------------------------