This repository was archived by the owner on Aug 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
321 lines (243 loc) · 11.7 KB
/
pyproject.toml
File metadata and controls
321 lines (243 loc) · 11.7 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
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 88
[tool.isort]
profile = "black"
# line-length = 88 # change also here if you alter default black line length
[tool.pytest]
minversion = "6.0"
addopts = "-ra -q"
testpaths = "tests"
[tool.docformatter]
args = ["--wrap-summaries=88", "--wrap-descriptions=88"]
exclude = '''
^/(
(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| venv
| _build
| buck-out
| build
| dist
)/
| foo.py # also separately exclude a file named foo.py in
# the root of the project
)
'''
[tool.pylint.master]
# Files or directories to be skipped. They should be base names", not paths.
ignore = "third_party"
# Pickle collected data for later comparisons.
persistent = "no"
# Use multiple processes to speed up Pylint.
jobs = 4
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension = "no"
[tool.pylint.basic]
# Allow shorter and longer variable names than the default.
argument-rgx = "[a-z_][a-z0-9_]*$"
attr-rgx = "[a-z_][a-z0-9_]*$"
variable-rgx = "[a-z_][a-z0-9_]*$"
# Regular expression matching correct constant names
const-rgx = "(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$"
# Regular expression matching correct function names
function-rgx = "(?:(?P<exempt>setUp|tearDown|setUpModule|tearDownModule)|(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$"
# Regular expression matching correct class attribute names
class-attribute-rgx = "(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$"
# Regular expression matching correct inline iteration names
inlinevar-rgx = "[a-z][a-z0-9_]*$"
# Regular expression matching correct class names
class-rgx = "_?[A-Z][a-zA-Z0-9]*$"
# Regular expression matching correct module names
module-rgx = "(_?[a-z][a-z0-9_]*|__init__)$"
# Regular expression matching correct method names
method-rgx = "(?x)^(?:(?P<exempt>_[a-z0-9_]+__|runTest|setUp|tearDown|setUpTestCase|tearDownTestCase|setupSelf|tearDownClass|setUpClass|(test|assert)_*[A-Z0-9][a-zA-Z0-9_]*|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9_]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$"
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx = "(__.*__|main|test.*|.*test|.*Test|Test.*|test_.*)$"
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length = 10
# Good variable names which should always be accepted, separated by a comma
good-names= "main,_"
# Include a hint for the correct naming format with invalid-name
include-naming-hint = "no"
# Ensure that orjson is analysed as a C extension by pylint.
extension-pkg-whitelist = "orjson"
# List of decorators that produce properties, such as abc.abstractproperty. Add
# to this list to register other decorators that produce valid properties.
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"
[tool.pylint.messages_control]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH", INFERENCE", INFERENCE_FAILURE", UNDEFINED
confidence= "HIGH"
disable = [
# Similar lines in files (often the case in tests).
"duplicate-code",
# Many functions (e.g. callbacks) will naturally have unused arguments.
"unused-argument",
# Disable checking that method could be a function in classes (often used for organisation).
"no-self-use",
# Disable failure for TO DO items in the codebase.
"fixme",
# disable import error because it has been check by isort
"import-error",
# Used when an abstract method (i.e. raise NotImplementedError) is not overridden in concrete class.
# "abstract-method",
# Used when a method has a different number of arguments than in the implemented interface or in an overridden method.
"arguments-differ",
# Used when an instance attribute is defined outside the __init__ method.
"attribute-defined-outside-init",
# Used when a bad value for an inline option is encountered.
"bad-option-value",
# Used when a variable is accessed for non-existent member of C extension. Due to unavailability of source static
# analysis is impossible, but it may be performed by introspecting living objects in run-time.
"c-extension-no-member",
# Used when you use the "global" statement to update a global variable. Pylint just try to discourage this usage.
# That doesn't mean you cannot use it !
"global-statement",
# Used when an inline option disables a message or a messages category.
"locally-disabled",
# Used when a function or method has no docstring.Some special methods like __init__ do not require a docstring.
"missing-function-docstring",
# Used when a class has no __init__ method, neither its parent classes.
"no-init",
# Used when a variable is accessed for an unexistent member.
"no-member",
# A message was triggered on a line, but suppressed explicitly by a disable= comment in the file. This message
# is not generated for messages that are ignored due to configuration settings.
"suppressed-message",
# too-few and too-many messages
"too-few-public-methods",
"too-many-ancestors",
"too-many-arguments",
"too-many-boolean-expressions",
"too-many-branches",
"too-many-instance-attributes",
"too-many-locals",
"too-many-nested-blocks",
"too-many-public-methods",
"too-many-return-statements",
"too-many-statements",
# Used when there is whitespace between the end of a line and the newline.
"trailing-newlines",
# Used when a class inherit from object, which under python3 is implicit, hence can be safely removed from bases.
"useless-object-inheritance",
# Reported when a message is explicitly disabled for a line or a block of code, but never triggered.
"useless-suppression",
# Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)
"wrong-import-order",
]
[tool.pylint.format]
# Maximum number of characters on a single line.
max-line-length = 88
# 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+.+$)"
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt = "yes"
# Maximum number of lines in a module
max-module-lines = 99999
# String used as indentation unit. The internal Google style guide mandates 2
# spaces. Google's externaly-published style guide says 4, consistent with
# PEP 8. Here, we use 2 spaces, for conformity with many open-sourced Google
# projects (like TensorFlow).
indent-string = ' '
# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren = 4
[tool.pylint.reports]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# oxapi.mymodule.MyReporterClass.
output-format = "text"
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]". This option is deprecated
# and it will be removed in Pylint 2.0.
files-output = "no"
# Tells whether to display a full report or only the messages
reports = "yes"
# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation = "10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)"
[tool.pylint.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"
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members = "yes"
# 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"
# 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 = "numpy.*, torch.*"
[tool.pylint.string]
# This flag controls whether inconsistent-quotes generates a warning when the
# character used as a quote delimiter is used inconsistently within a module.
check-quote-consistency = "yes"
[tool.pylint.variables]
# Tells whether we should check for unused import in __init__ files.
init-import = "no"
# A regular expression matching the name of dummy variables (i.e. expectedly
# not used).
dummy-variables-rgx = "^\\*{0,2}(_$|unused_|dummy_)"
# List of strings which can identify a callback function by name. A callback
# name must start or end with one of those strings.
callbacks = "cb_,_cb"
# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules = "six,six.moves,past.builtins,future.builtins,functools"
[tool.pylint.logging]
# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules = "logging,absl.logging,tensorflow.io.logging"
[tool.pylint.similarities]
# Minimum lines number of a similarity.
min-similarity-lines=4
# Ignore comments when computing similarities.
ignore-comments = "yes"
# Ignore docstrings when computing similarities.
ignore-docstrings = "yes"
# Ignore imports when computing similarities.
ignore-imports = "no"
[tool.pylint.spelling]
# Tells whether to store unknown words to indicated private dictionary in
# --spelling-private-dict-file option instead of raising a message.
spelling-store-unknown-words = "no"
[tool.pylint.imports]
# 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"
# Analyse import fallback blocks. This can be used to support both Python 2 and
# 3 compatible code, which means that the block might have code that exists
# only in one or another interpreter, leading to false positives when analysed.
analyse-fallback-blocks = "no"
[tool.pylint.classes]
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods = "__init__,__new__,setUp"
# List of member names, which should be excluded from the protected access
# warning.
exclude-protected = "_asdict,_fields,_replace,_source,_make"
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg = "cls,class_"
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg = "mcs"
[tool.pylint.exceptions]
# Exceptions that will emit a warning when being caught. Defaults to "Exception"
overgeneral-exceptions = "StandardError,Exception,BaseException"