This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
140 lines (125 loc) · 3.9 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
# install
# pip3 install pre-commit
# run
# pre-commit run -a
# or
# pre-commit run --files myFile1.py myFile2.py
# update hooks to latest version
# pre-commit autoupdate
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
# see https://github.com/pre-commit/pre-commit-hooks
- id: check-added-large-files
args: ['--maxkb=500']
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
# - id: detect-aws-credentials
- id: detect-private-key
# conflict with black below
# - id: double-quote-string-fixer
# not: since it conflicts with python gen. json files
# - id: end-of-file-fixer
- id: file-contents-sorter
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args: ["--remove"]
- id: forbid-new-submodules
# - id: forbid-submodules
# args: ['--fix=lf']
- id: name-tests-test
# - id: no-commit-to-branch
# args: [--branch, staging]
# not, since it decodes utf-8
# - id: pretty-format-json
# args: ["--autofix"]
- id: requirements-txt-fixer
# - id: sort-simple-yaml
- id: trailing-whitespace
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
# not, black is enough
# - repo: https://github.com/pre-commit/mirrors-autopep8
# rev: v2.0.1
# hooks:
# - id: autopep8
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: python-check-blanket-noqa
# not, since '# type: ignore' is ok for me
# - id: python-check-blanket-type-ignore
- id: python-check-mock-methods
- id: python-no-eval
- id: python-no-log-warn
- id: python-use-type-annotations
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- id: text-unicode-replacement-char
# problem: collides with black. since it splits multiple 'from imports'
# - repo: https://github.com/asottile/reorder_python_imports
# rev: v3.9.0
# hooks:
# - id: reorder-python-imports
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py310-plus"]
# not for only for projects where type hints have been added
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.991
# hooks:
# - id: mypy
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
# NOTE: entries are copy of .flake8-config-file -> for auto-install
# Bugs
- flake8-bugbear
- flake8-secure-coding-standard
- flake8-bandit
- flake8-builtins
# Clean Code
- flake8-comprehensions
- flake8-simplify
# - flake8-eradicate
- flake8-commas
# Limitations
- flake8-blind-except
- flake8-logging-format
# - flake8-print
# Documentation
- flake8-comments
- flake8-docstrings
- flake8-rst-docstrings
# Test-Improvements
- flake8-assertive
# - repo: https://github.com/codespell-project/codespell
# rev: "v2.2.2"
# hooks:
# - id: codespell
default_language_version:
python: python3.10