-
Notifications
You must be signed in to change notification settings - Fork 36
/
.pre-commit-config.yaml
119 lines (104 loc) · 3.39 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
# How to install:
# pre-commit install --install-hooks && pre-commit install --install-hooks -t commit-msg
default_language_version:
python: python3
# How temporary skip one of hooks: https://pre-commit.com/#temporarily-disabling-hooks
repos:
#######
# ALL #
#######
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
# Git style
- id: check-added-large-files
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: forbid-new-submodules
- id: no-commit-to-branch
# Common errors
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
# Cross platform
- id: check-case-conflict
# Security
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: detect-private-key
#############
# TERRAFORM #
#############
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.43.0
hooks:
- id: terraform_fmt
- id: terraform_docs
##########
# PYTHON #
##########
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.3.5
hooks:
- id: reorder-python-imports
language_version: python3.8
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.0.1
hooks:
- id: add-trailing-comma
language_version: python3.8
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.5.4
hooks:
- id: autopep8
language_version: python3.8
args:
- -i
- --max-line-length=100
# Usage: http://pylint.pycqa.org/en/latest/user_guide/message-control.html
- repo: https://github.com/PyCQA/pylint
rev: pylint-2.6.0
hooks:
- id: pylint
language_version: python3.8
# Think about this: https://github.com/shalb/cluster.dev/pull/70#discussion_r431190998
args:
- --disable=import-error # E0401. Locally you could not have all imports.
- --disable=fixme # W0511. 'TODO' notations.
- --disable=bad-continuation # Will be removed in pylint-2.6.0. Use wemake-python-styleguide.
- --disable=logging-fstring-interpolation # Conflict with "use a single formatting" WPS323
- --disable=ungrouped-imports # ignore `if TYPE_CHECKING` case. Other do reorder-python-imports
- --min-similarity-lines=8 # ignore stubs of dev dependencies
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.790
hooks:
- id: mypy
language_version: python3.8
args: [
--ignore-missing-imports,
--disallow-untyped-calls,
--warn-redundant-casts,
]
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.8.4
hooks:
- id: flake8
language_version: python3.8
additional_dependencies:
- flake8-2020
- flake8-docstrings
- flake8-pytest-style
- wemake-python-styleguide
args:
- --max-returns=2 # Default settings
- --max-arguments=4 # Default settings
- --max-string-usages=6 # Project specific. Default - 3
- --max-local-variables=6 # Project specific. Default - 5
- --max-module-members=10 # Project specific. Default - 7
# https://www.flake8rules.com/
# https://wemake-python-stylegui.de/en/latest/pages/usage/violations/index.html
- --extend-ignore=
WPS305, <!-- Found `f` string -->
E501, <!-- line too long (> 79 characters). Use 100 -->
I, <!-- opt out of using isort in favor of reorder-python-imports -->
RST, <!-- Conflict with DAR -->