-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathpylintrc
More file actions
346 lines (259 loc) · 10 KB
/
pylintrc
File metadata and controls
346 lines (259 loc) · 10 KB
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
###########################################################################
# This pylintrc file contains a best-effort configuration to uphold the
# best-practices and style for the Python track of exercism.org.
#
# It is based on the default pylint rc with enabled extensions, and is the same
# pylintrc file used in our generic Analyzer.
#
# Additions & alterations to the base configuration are noted in
# the Exercism Python Track contributing guide:
# https://github.com/exercism/python/blob/main/CONTRIBUTING.md
###########################################################################
[MAIN]
analyse-fallback-blocks=no
clear-cache-post-run=yes
extension-pkg-allow-list=
extension-pkg-whitelist=
ignore=third_party
jobs=4
limit-inference-results=100
unsafe-load-any-extension=no
persistent=no
prefer-stubs=no
recursive=no
# Specify a score threshold under which the program will exit with error.
fail-under=10
# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins = pylint.extensions.bad_builtin,
# pylint.extensions.code_style,
pylint.extensions.comparison_placement,
pylint.extensions.consider_refactoring_into_while_condition,
# pylint.extensions.docparams,
pylint.extensions.dunder,
pylint.extensions.eq_without_hash,
pylint.extensions.for_any_all,
# pylint.extensions.mccabe,
pylint.extensions.no_self_use,
pylint.extensions.overlapping_exceptions,
pylint.extensions.private_import,
pylint.extensions.redefined_loop_name,
pylint.extensions.set_membership,
[BASIC]
module-naming-style=snake_case
const-naming-style=UPPER_CASE
variable-naming-style=snake_case
function-naming-style=snake_case
argument-naming-style=snake_case
attr-naming-style=snake_case
class-naming-style=PascalCase
class-attribute-naming-style=any
class-const-naming-style=UPPER_CASE
method-naming-style=snake_case
inlinevar-naming-style=snake_case
# Include a hint for the correct naming format with invalid-name.
include-naming-hint=yes
# Bad variable names which should always be refused, separated by a comma.
bad-names=x,
y,
i,
l,
a,
b,
j,
o,
z
# Good variable names which should always be accepted, separated by a comma.
good-names=main,
# List of decorators that produce properties, such as abc.abstractproperty. Add
# to this list to register other decorators that produce valid properties.
# These decorators are taken in consideration only for invalid-name.
property-classes=abc.abstractproperty,
cached_property.cached_property,
cached_property.threaded_cached_property,
cached_property.cached_property_with_ttl,
cached_property.threaded_cached_property_with_ttl
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=5
# Bad variable names regexes, separated by a comma. If names match any regex,
# they will always be refused
bad-names-rgxs=^.{1,2}$
# Good variable names regexes, separated by a comma. If names match any regex,
# they will always be accepted
good-names-rgxs=
[CLASSES]
check-protected-access-in-special-methods=no
defining-attr-methods=__init__,
__new__,
setUp
exclude-protected=_asdict,
_fields,
_replace,
_source,
_make
valid-classmethod-first-arg=cls,
class_
valid-metaclass-classmethod-first-arg=mcs
[DESIGN]
max-args=5
max-attributes=7
max-bool-expr=5
max-branches=12
max-locals=15
max-parents=7
max-positional-arguments=5
max-public-methods=20
max-returns=6
max-statements=50
min-public-methods=2
[EXCEPTIONS]
# Exceptions that will emit a warning when caught.
overgeneral-exceptions=StandardError,
Exception,
BaseException
[FORMAT]
# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren=4
# Maximum number of characters on a single line.
max-line-length=120
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=(?x)(^\s*(\#\ )?<?https?://\S+>?$|^\s*(from\s+\S+\s+)?import\s+.+$)
# Maximum number of lines in a module.
max-module-lines=99999
single-line-class-stmt=no
single-line-if-stmt=yes
[IMPORTS]
# Allow explicit reexports by alias from a package __init__.
allow-reexport-from-package=no
# Allow wildcard imports from modules that define __all__.
allow-wildcard-with-all=no
# Deprecated modules which should not be used, separated by a comma.
deprecated-modules=regsub,
TERMIOS,
Bastion,
rexec,
sets
# Force import order to recognize a module as part of a third party library.
known-third-party=enchant,
absl
[LOGGING]
# The type of string formatting that logging methods do. `old` means using %
# formatting, `new` is for `{}` formatting.
logging-format-style=old
# Logging modules to check that the string format arguments are in logging
# function parameter format.
logging-modules=logging,absl.logging
[MESSAGES CONTROL]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
# UNDEFINED.
confidence=HIGH,
CONTROL_FLOW,
INFERENCE,
INFERENCE_FAILURE,
UNDEFINED
# Disable the message, report, category or checker with the given id(s).
disable=raw-checker-failed,
locally-disabled,
suppressed-message,
arguments-differ,
fixme,
line-too-long,
global-statement,
import-error,
no-member,
signature-differs,
too-many-locals,
too-many-public-methods,
too-many-return-statements,
too-many-statements,
unnecessary-pass
# Include some helpful details on errors messages for naming rules:
include-naming-hint = yes
[METHOD_ARGS]
# List of qualified names (i.e., library.method) which require a timeout
# parameter e.g. 'requests.api.get,requests.api.post'
timeout-methods=requests.api.delete,
requests.api.get,
requests.api.head,
requests.api.options,
requests.api.patch,
requests.api.post,
requests.api.put,
requests.api.request
[MISCELLANEOUS]
check-fixme-in-docstring=no
notes=TODO
[REFACTORING]
# Maximum number of nested blocks for function / method body
max-nested-blocks=5
# Complete name of functions that never returns. When checking for
# inconsistent-return-statements if a never returning function is called then
# it will be considered as an explicit return statement and no message will be
# printed.
never-returning-functions=sys.exit,argparse.parse_error
# Let 'consider-using-join' be raised when the separator to join on would be
# non-empty (resulting in expected fixes of the type: ``"- " + " -
# ".join(items)``)
suggest-join-with-non-empty-separator=yes
[REPORTS]
reports=no
[SPELLING]
# Limits count of emitted suggestions for spelling mistakes.
max-spelling-suggestions=4
# List of comma separated words that should be considered directives if they
# appear at the beginning of a comment and should not be checked.
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
spelling-store-unknown-words=no
[STRING]
check-quote-consistency=yes
check-str-concat-over-line-jumps=yes
[VARIABLES]
allow-global-unused-variables=yes
dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_)
ignored-argument-names=_.*|^ignored_|^unused_
redefining-builtins-modules=six,six.moves,past.builtins,future.builtins,functools
# Tells whether we should check for unused import in __init__ files.
init-import=no
[TYPECHECK]
# List of decorators that produce context managers, such as
# contextlib.contextmanager. Add to this list to register other decorators that
# produce valid context managers.
contextmanager-decorators=contextlib.contextmanager,contextlib2.contextmanager
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=
# Tells whether to warn about missing members when the owner of the attribute
# is inferred to be None.
ignore-none=yes
# This flag controls whether pylint should warn about no-member and similar
# checks whenever an opaque object is returned when inferring. The inference
# can return multiple potential results while evaluating a Python object, but
# some branches might not be evaluated, which results in partial inference. In
# that case, it might be useful to still emit no-member and other checks for
# the rest of the inferred objects.
ignore-on-opaque-inference=yes
# List of symbolic message names to ignore for Mixin members.
ignored-checks-for-mixins=no-member,
not-async-context-manager,
not-context-manager,
attribute-defined-outside-init
# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
ignored-classes=optparse.Values,thread._local,_thread._local
# Show a hint with possible names when a member name was not found. The aspect
# of finding the hint is based on edit distance.
missing-member-hint=yes
# The maximum edit distance a name should have in order to be considered a
# similar match for a missing member name.
missing-member-hint-distance=1
# The total number of similar names that should be taken in consideration when
# showing a hint for a missing member.
missing-member-max-choices=1
# Regex pattern to define which classes are considered mixins.
mixin-class-rgx=.*[Mm]ixin
# List of decorators that change the signature of a decorated function.
signature-mutators=