This repository has been archived by the owner on Mar 31, 2023. It is now read-only.
forked from NoneGG/aredis
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
160 lines (157 loc) · 5.21 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
ci:
autofix_commit_msg: 'refactor(lint): apply automatic lint fixes'
autoupdate_commit_msg: 'chore(deps): bump pre-commit linter versions'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-case-conflict
- 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-vcs-permalinks
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
# python
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
- id: debug-statements
- id: double-quote-string-fixer
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/PyCQA/pylint
rev: v2.15.7
hooks:
- id: pylint
additional_dependencies:
- pylint-import-modules==0.3.0
args:
- --allowed-direct-imports="typing.*"
- --load-plugins=pylint_import_modules,pylint.extensions.mccabe
- --max-complexity=10
# - --max-line-length=79 # TODO: enable me
- --max-line-length=179
- --max-args=10
- --score=n
- -d broad-except
- -d duplicate-code
- -d fixme
- -d import-error
- -d import-only-modules
- -d invalid-name
- -d locally-disabled
- -d missing-docstring
- -d too-few-public-methods
- -d too-many-arguments # some redis commands have lots of args
- -d try-except-raise
- -d ungrouped-imports # conflicts with reorder-python-imports
- -d wrong-import-order # conflicts with reorder-python-imports
- -d unused-argument # TODO: enable me
- -d redefined-outer-name # TODO: enable me
- -d attribute-defined-outside-init # TODO: enable me
- -d arguments-differ # TODO: enable me
- -d cyclic-import # TODO: enable me
- -d deprecated-module # TODO: enable me
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.1
hooks:
- id: remove-crlf
- id: remove-tabs
# TODO: fix https://app.circleci.com/pipelines/github/talkiq/yaaredis/120/workflows/b9d7c40a-7ee6-43b3-9f49-1eed559a126b/jobs/7314
# - repo: https://github.com/asottile/reorder_python_imports
# rev: v3.9.0
# hooks:
# - id: reorder-python-imports
# args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.3
hooks:
- id: pyupgrade
args: [--py36-plus]
# TODO: enable me
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.991
# hooks:
# - id: mypy
# require_serial: True
# # N.B. mypy requires an installed version of whatever third-party
# # library it is asked to check against. In practice, that means
# # whenever we see an error telling us to do so, we should add the
# # relevant library to `additional_dependencies`.
# # Note that some libraries keep their type hints in packages named
# # `types-$lib` or `$lib-stubs`.
# additional_dependencies: []
# args:
# - --show-error-codes
# - --strict
# - --strict-equality
# - --warn-unreachable
- repo: https://github.com/asottile/yesqa
rev: v1.4.0
hooks:
- id: yesqa
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.0
hooks:
- id: autopep8
args: [-a, -i, -p2]
# TODO: enable me
# - repo: https://github.com/PyCQA/pydocstyle
# rev: 6.1.1
# hooks:
# - id: pydocstyle
# additional_dependencies:
# - toml
# args:
# - --ignore=D1,D203,D205,D212,D400,D401,D404,D407,D412,D413
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies:
- flake8-2020==1.7.0
- flake8-broken-line==0.5.0
- flake8-builtins==1.5.3
- flake8-commas==2.1.0
- flake8-comprehensions==3.10.0
- flake8-typing-imports==1.14.0
args:
# TODO: enable A001,A002,A003,C406
- --ignore=A001,A002,A003,C406,E501,W503,F401,F811
- repo: local
hooks:
- id: poetry-check
name: Poetry check
description: 'Validate the structure of the pyproject.toml file'
entry: poetry check
language: python
additional_dependencies:
- poetry>=1.2.0
pass_filenames: false
types: [toml]
- id: pytest-fixture-require-scope
name: Require explicit scope for pytest fixtures
description: 'Ensure we explicitly set pytest fixture scopes'
entry: '@pytest\.fixture( |\n|(\(\)))'
language: pygrep
types: [python]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
# - id: python-no-eval # TODO: enable me
# - id: python-no-log-warn # TODO: enable me
- id: python-use-type-annotations
# rst
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal