Easier and more self documenting patterns for loading/saving Persistent
[python_utils.git] / pyproject.toml
1 [tool.mypy]
2 python_version="3.8"
3 ignore_missing_imports=true
4 namespace_packages=true
5 mypy_path="/home/scott/lib/python_modules"
6 pretty=true
7 exclude = [
8     "dateparse_utilsParser.py$",
9     "dateparse_utilsLexer.py$",
10     "dateparse_utilsListener.py$",
11 ]
12
13 [tool.black]
14 color=true
15 skip-string-normalization=true
16 line-length=100
17
18 [tool.isort]
19 profile="black"
20 sections="FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
21 no_lines_before="STDLIB"
22 known_first_party = [
23     "acl", "ansi", "argparse_utils", "arper", "base_presence", "bootstrap", "camera_utils",
24     "config", "constants", "conversion_utils", "datetime_utils", "decorator_utils", "deferred_operand",
25     "dict_utils", "directory_filter", "exceptions", "exec_utils", "executors", "file_utils",
26     "function_utils", "google_assistant", "histogram", "id_generator", "input_utils", "letter_compress",
27     "list_utils", "lockfile", "logging_utils", "logical_search", "math_utils", "misc_utils",
28     "orb_utils", "parallelize", "persistent", "profanity_filter", "remote_worker", "scott_secrets",
29     "site_config", "smart_future", "state_tracker", "stopwatch", "string_utils", "text_utils",
30     "thread_utils", "type_utils", "unittest_utils", "unscrambler", "waitable_presence",
31     "smart_home.cameras", "smart_home.chromecasts", "smart_home.device_utils", "smart_home.device",
32     "smart_home.lights", "smart_home.outlets", "smart_home.registry", "smart_home.thermometers",
33     "cached.weather_data", "cached.weather_forecast", "collect.bidict", "collect.bst",
34     "collect.shared_dict", "collect.trie", "dateparse.dateparse_utils", "ml.model_trainer",
35     "ml.quick_label", "type.centcount", "type.locations", "type.money", "type.people",
36     "type.rate",
37 ]
38
39 [tool.pylint]
40 [tool.pylint.MASTER]
41
42 # A comma-separated list of package or module names from where C extensions may
43 # be loaded. Extensions are loading into the active Python interpreter and may
44 # run arbitrary code.
45 extension-pkg-allow-list="cv2"
46
47 # A comma-separated list of package or module names from where C extensions may
48 # be loaded. Extensions are loading into the active Python interpreter and may
49 # run arbitrary code. (This is an alternative name to extension-pkg-allow-list
50 # for backward compatibility.)
51 #extension-pkg-whitelist=
52
53 # Return non-zero exit code if any of these messages/categories are detected,
54 # even if score is above --fail-under value. Syntax same as enable. Messages
55 # specified are enabled, while categories only check already-enabled messages.
56 #fail-on=
57
58 # Specify a score threshold to be exceeded before program exits with error.
59 fail-under=8.0
60
61 # Files or directories to be skipped. They should be base names, not paths.
62 ignore="CVS"
63
64 # Add files or directories matching the regex patterns to the ignore-list. The
65 # regex matches against paths and can be in Posix or Windows format.
66 #ignore-paths=
67
68 # Files or directories matching the regex patterns are skipped. The regex
69 # matches against base names, not paths.
70 #ignore-patterns=
71
72 # Python code to execute, usually for sys.path manipulation such as
73 # pygtk.require().
74 #init-hook=
75
76 # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
77 # number of processors available to use.
78 jobs=1
79
80 # Control the amount of potential inferred values when inferring a single
81 # object. This can help the performance when dealing with large functions or
82 # complex, nested conditions.
83 limit-inference-results=100
84
85 # List of plugins (as comma separated values of python module names) to load,
86 # usually to register additional checkers.
87 #load-plugins=
88
89 # Pickle collected data for later comparisons.
90 persistent="yes"
91
92 # Minimum Python version to use for version dependent checks. Will default to
93 # the version used to run pylint.
94 py-version=3.8
95
96 # When enabled, pylint would attempt to guess common misconfiguration and emit
97 # user-friendly hints instead of false-positive error messages.
98 suggestion-mode="yes"
99
100 # Allow loading of arbitrary C extensions. Extensions are imported into the
101 # active Python interpreter and may run arbitrary code.
102 unsafe-load-any-extension="no"
103
104 [tool.pylint.'MESSAGES CONTROL']
105
106 # Only show warnings with the listed confidence levels. Leave empty to show
107 # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
108 #confidence=
109
110 # Disable the message, report, category or checker with the given id(s). You
111 # can either give multiple identifiers separated by comma (,) or put this
112 # option multiple times (only on the command line, not in the configuration
113 # file where it should appear only once). You can also use "--disable=all" to
114 # disable everything first and then reenable specific checks. For example, if
115 # you want to run only the similarities checker, you can use "--disable=all
116 # --enable=similarities". If you want to run only the classes checker, but have
117 # no Warning level messages displayed, use "--disable=all --enable=classes
118 # --disable=W".
119 disable="invalid-name, missing-function-docstring, useless-object-inheritance, unspecified-encoding, import-outside-toplevel, raw-checker-failed, bad-inline-option, locally-disabled, line-too-long, too-few-public-methods, file-ignored, suppressed-message, useless-suppression, no-else-return, no-else-raise, no-else-break, deprecated-pragma, unnecessary-pass, use-symbolic-message-instead, broad-except, wrong-import-order"
120
121 # Enable the message, report, category or checker with the given id(s). You can
122 # either give multiple identifier separated by comma (,) or put this option
123 # multiple time (only on the command line, not in the configuration file where
124 # it should appear only once). See also the "--disable" option for examples.
125 enable="c-extension-no-member"
126
127 [tool.pylint.REPORTS]
128
129 # Python expression which should return a score less than or equal to 10. You
130 # have access to the variables 'error', 'warning', 'refactor', and 'convention'
131 # which contain the number of messages in each category, as well as 'statement'
132 # which is the total number of statements analyzed. This score is used by the
133 # global evaluation report (RP0004).
134 evaluation="10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)"
135
136 # Template used to display messages. This is a python new-style format string
137 # used to format the message information. See doc for all details.
138 #msg-template=
139
140 # Set the output format. Available formats are text, parseable, colorized, json
141 # and msvs (visual studio). You can also give a reporter class, e.g.
142 # mypackage.mymodule.MyReporterClass.
143 output-format="text"
144
145 # Tells whether to display a full report or only the messages.
146 reports="no"
147
148 # Activate the evaluation score.
149 score="no"
150
151 [tool.pylint.REFACTORING]
152
153 # Maximum number of nested blocks for function / method body
154 max-nested-blocks=5
155
156 # Complete name of functions that never returns. When checking for
157 # inconsistent-return-statements if a never returning function is called then
158 # it will be considered as an explicit return statement and no message will be
159 # printed.
160 never-returning-functions="sys.exit,argparse.parse_error"
161
162 [tool.pylint.BASIC]
163
164 # Naming style matching correct argument names.
165 argument-naming-style="snake_case"
166
167 # Regular expression matching correct argument names. Overrides argument-
168 # naming-style.
169 #argument-rgx=
170
171 # Naming style matching correct attribute names.
172 attr-naming-style="snake_case"
173
174 # Regular expression matching correct attribute names. Overrides attr-naming-
175 # style.
176 #attr-rgx=
177
178 # Bad variable names which should always be refused, separated by a comma.
179 bad-names="foo, baz, toto, tutu, tata, caca"
180
181 # Bad variable names regexes, separated by a comma. If names match any regex,
182 # they will always be refused
183 #bad-names-rgxs=
184
185 # Naming style matching correct class attribute names.
186 class-attribute-naming-style="any"
187
188 # Regular expression matching correct class attribute names. Overrides class-
189 # attribute-naming-style.
190 #class-attribute-rgx=
191
192 # Naming style matching correct class constant names.
193 class-const-naming-style="UPPER_CASE"
194
195 # Regular expression matching correct class constant names. Overrides class-
196 # const-naming-style.
197 #class-const-rgx=
198
199 # Naming style matching correct class names.
200 class-naming-style="PascalCase"
201
202 # Regular expression matching correct class names. Overrides class-naming-
203 # style.
204 #class-rgx=
205
206 # Naming style matching correct constant names.
207 const-naming-style="UPPER_CASE"
208
209 # Regular expression matching correct constant names. Overrides const-naming-
210 # style.
211 #const-rgx=
212
213 # Minimum line length for functions/classes that require docstrings, shorter
214 # ones are exempt.
215 docstring-min-length=-1
216
217 # Naming style matching correct function names.
218 function-naming-style="snake_case"
219
220 # Regular expression matching correct function names. Overrides function-
221 # naming-style.
222 #function-rgx=
223
224 # Good variable names which should always be accepted, separated by a comma.
225 good-names="i, j, k, x, y, z, e, ex"
226
227 # Good variable names regexes, separated by a comma. If names match any regex,
228 # they will always be accepted
229 #good-names-rgxs=
230
231 # Include a hint for the correct naming format with invalid-name.
232 include-naming-hint="no"
233
234 # Naming style matching correct inline iteration names.
235 inlinevar-naming-style="any"
236
237 # Regular expression matching correct inline iteration names. Overrides
238 # inlinevar-naming-style.
239 #inlinevar-rgx=
240
241 # Naming style matching correct method names.
242 method-naming-style="snake_case"
243
244 # Regular expression matching correct method names. Overrides method-naming-
245 # style.
246 #method-rgx=
247
248 # Naming style matching correct module names.
249 module-naming-style="snake_case"
250
251 # Regular expression matching correct module names. Overrides module-naming-
252 # style.
253 #module-rgx=
254
255 # Colon-delimited sets of names that determine each other's naming style when
256 # the name regexes allow several styles.
257 #name-group=
258
259 # Regular expression which should only match function or class names that do
260 # not require a docstring.
261 no-docstring-rgx="^_"
262
263 # List of decorators that produce properties, such as abc.abstractproperty. Add
264 # to this list to register other decorators that produce valid properties.
265 # These decorators are taken in consideration only for invalid-name.
266 property-classes="abc.abstractproperty"
267
268 # Naming style matching correct variable names.
269 variable-naming-style="snake_case"
270
271 # Regular expression matching correct variable names. Overrides variable-
272 # naming-style.
273 #variable-rgx=
274
275 [tool.pylint.MISCELLANEOUS]
276
277 # List of note tags to take in consideration, separated by a comma.
278 notes="FIXME, XXX, TODO"
279
280 # Regular expression of note tags to take in consideration.
281 #notes-rgx=
282
283 [tool.pylint.TYPECHECK]
284
285 # List of decorators that produce context managers, such as
286 # contextlib.contextmanager. Add to this list to register other decorators that
287 # produce valid context managers.
288 contextmanager-decorators="contextlib.contextmanager"
289
290 # List of members which are set dynamically and missed by pylint inference
291 # system, and so shouldn't trigger E1101 when accessed. Python regular
292 # expressions are accepted.
293 generated-members="io.*,cv2.*"
294
295 # Tells whether missing members accessed in mixin class should be ignored. A
296 # class is considered mixin if its name matches the mixin-class-rgx option.
297 ignore-mixin-members="yes"
298
299 # Tells whether to warn about missing members when the owner of the attribute
300 # is inferred to be None.
301 ignore-none="yes"
302
303 # This flag controls whether pylint should warn about no-member and similar
304 # checks whenever an opaque object is returned when inferring. The inference
305 # can return multiple potential results while evaluating a Python object, but
306 # some branches might not be evaluated, which results in partial inference. In
307 # that case, it might be useful to still emit no-member and other checks for
308 # the rest of the inferred objects.
309 ignore-on-opaque-inference="yes"
310
311 # List of class names for which member attributes should not be checked (useful
312 # for classes with dynamically set attributes). This supports the use of
313 # qualified names.
314 ignored-classes="optparse.Values,thread._local,_thread._local"
315
316 # List of module names for which member attributes should not be checked
317 # (useful for modules/projects where namespaces are manipulated during runtime
318 # and thus existing member attributes cannot be deduced by static analysis). It
319 # supports qualified module names, as well as Unix pattern matching.
320 #ignored-modules=
321
322 # Show a hint with possible names when a member name was not found. The aspect
323 # of finding the hint is based on edit distance.
324 missing-member-hint="yes"
325
326 # The minimum edit distance a name should have in order to be considered a
327 # similar match for a missing member name.
328 missing-member-hint-distance=1
329
330 # The total number of similar names that should be taken in consideration when
331 # showing a hint for a missing member.
332 missing-member-max-choices=1
333
334 # Regex pattern to define which classes are considered mixins ignore-mixin-
335 # members is set to 'yes'
336 mixin-class-rgx=".*[Mm]ixin"
337
338 # List of decorators that change the signature of a decorated function.
339 signature-mutators="thread_utils.background_thread"
340
341 [tool.pylint.VARIABLES]
342
343 # List of additional names supposed to be defined in builtins. Remember that
344 # you should avoid defining new builtins when possible.
345 #additional-builtins=
346
347 # Tells whether unused global variables should be treated as a violation.
348 allow-global-unused-variables="yes"
349
350 # List of names allowed to shadow builtins
351 #allowed-redefined-builtins=
352
353 # List of strings which can identify a callback function by name. A callback
354 # name must start or end with one of those strings.
355 callbacks="cb_, _cb"
356
357 # A regular expression matching the name of dummy variables (i.e. expected to
358 # not be used).
359 dummy-variables-rgx="_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_"
360
361 # Argument names that match this expression will be ignored. Default to name
362 # with leading underscore.
363 ignored-argument-names="_.*|^ignored_|^unused_"
364
365 # Tells whether we should check for unused import in __init__ files.
366 init-import="no"
367
368 # List of qualified module names which can have objects that can redefine
369 # builtins.
370 redefining-builtins-modules="six.moves,past.builtins,future.builtins,builtins,io"
371
372 [tool.pylint.FORMAT]
373
374 # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
375 #expected-line-ending-format=
376
377 # Regexp for a line that is allowed to be longer than the limit.
378 #ignore-long-lines="^\s*(# )?<?https?://\S+>?$"
379
380 # Number of spaces of indent required inside a hanging or continued line.
381 indent-after-paren=4
382
383 # String used as indentation unit. This is usually "    " (4 spaces) or "\t" (1
384 # tab).
385 indent-string='    '
386
387 # Maximum number of characters on a single line.
388 max-line-length=100
389
390 # Maximum number of lines in a module.
391 max-module-lines=1000
392
393 # Allow the body of a class to be on the same line as the declaration if body
394 # contains single statement.
395 single-line-class-stmt="no"
396
397 # Allow the body of an if to be on the same line as the test if there is no
398 # else.
399 single-line-if-stmt="no"
400
401 [tool.pylint.STRING]
402
403 # This flag controls whether inconsistent-quotes generates a warning when the
404 # character used as a quote delimiter is used inconsistently within a module.
405 check-quote-consistency="no"
406
407 # This flag controls whether the implicit-str-concat should generate a warning
408 # on implicit string concatenation in sequences defined over several lines.
409 check-str-concat-over-line-jumps="no"
410
411 [tool.pylint.LOGGING]
412
413 # The type of string formatting that logging methods do. `old` means using %
414 # formatting, `new` is for `{}` formatting.
415 logging-format-style="old"
416
417 # Logging modules to check that the string format arguments are in logging
418 # function parameter format.
419 logging-modules="logging"
420
421 [tool.pylint.SPELLING]
422
423 # Limits count of emitted suggestions for spelling mistakes.
424 max-spelling-suggestions=4
425
426 # Spelling dictionary name. Available dictionaries: none. To make it work,
427 # install the 'python-enchant' package.
428 #spelling-dict=
429
430 # List of comma separated words that should be considered directives if they
431 # appear and the beginning of a comment and should not be checked.
432 spelling-ignore-comment-directives="fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:"
433
434 # List of comma separated words that should not be checked.
435 #spelling-ignore-words=
436
437 # A path to a file that contains the private dictionary; one word per line.
438 #spelling-private-dict-file=
439
440 # Tells whether to store unknown words to the private dictionary (see the
441 # --spelling-private-dict-file option) instead of raising a message.
442 spelling-store-unknown-words="no"
443
444 [tool.pylint.SIMILARITIES]
445
446 # Comments are removed from the similarity computation
447 ignore-comments="yes"
448
449 # Docstrings are removed from the similarity computation
450 ignore-docstrings="yes"
451
452 # Imports are removed from the similarity computation
453 ignore-imports="no"
454
455 # Signatures are removed from the similarity computation
456 ignore-signatures="no"
457
458 # Minimum lines number of a similarity.
459 min-similarity-lines=4
460
461 [tool.pylint.DESIGN]
462
463 # List of regular expressions of class ancestor names to ignore when counting
464 # public methods (see R0903)
465 #exclude-too-few-public-methods=
466
467 # List of qualified class names to ignore when counting class parents (see
468 # R0901)
469 #ignored-parents=
470
471 # Maximum number of arguments for function / method.
472 max-args=6
473
474 # Maximum number of attributes for a class (see R0902).
475 max-attributes=7
476
477 # Maximum number of boolean expressions in an if statement (see R0916).
478 max-bool-expr=5
479
480 # Maximum number of branch for function / method body.
481 max-branches=13
482
483 # Maximum number of locals for function / method body.
484 max-locals=17
485
486 # Maximum number of parents for a class (see R0901).
487 max-parents=7
488
489 # Maximum number of public methods for a class (see R0904).
490 max-public-methods=20
491
492 # Maximum number of return / yield for function / method body.
493 max-returns=8
494
495 # Maximum number of statements in function / method body.
496 max-statements=66
497
498 # Minimum number of public methods for a class (see R0903).
499 min-public-methods=2
500
501 [tool.pylint.CLASSES]
502
503 # Warn about protected attribute access inside special methods
504 check-protected-access-in-special-methods="no"
505
506 # List of method names used to declare (i.e. assign) instance attributes.
507 defining-attr-methods="__init__, __new__, setUp, __post_init__"
508
509 # List of member names, which should be excluded from the protected access
510 # warning.
511 exclude-protected="_asdict, _fields, _replace, _source, _make"
512
513 # List of valid names for the first argument in a class method.
514 valid-classmethod-first-arg="cls"
515
516 # List of valid names for the first argument in a metaclass class method.
517 valid-metaclass-classmethod-first-arg="cls"
518
519 [tool.pylint.IMPORTS]
520
521 # List of modules that can be imported at any level, not just the top level
522 # one.
523 #allow-any-import-level=
524
525 # Allow wildcard imports from modules that define __all__.
526 allow-wildcard-with-all="no"
527
528 # Analyse import fallback blocks. This can be used to support both Python 2 and
529 # 3 compatible code, which means that the block might have code that exists
530 # only in one or another interpreter, leading to false positives when analysed.
531 analyse-fallback-blocks="no"
532
533 # Deprecated modules which should not be used, separated by a comma.
534 #deprecated-modules=
535
536 # Output a graph (.gv or any supported image format) of external dependencies
537 # to the given file (report RP0402 must not be disabled).
538 #ext-import-graph=
539
540 # Output a graph (.gv or any supported image format) of all (i.e. internal and
541 # external) dependencies to the given file (report RP0402 must not be
542 # disabled).
543 #import-graph=
544
545 # Output a graph (.gv or any supported image format) of internal dependencies
546 # to the given file (report RP0402 must not be disabled).
547 #int-import-graph=
548
549 # Force import order to recognize a module as part of the standard
550 # compatibility libraries.
551 #known-standard-library=
552
553 # Force import order to recognize a module as part of a third party library.
554 known-third-party="enchant"
555
556 # Couples of modules and preferred modules, separated by a comma.
557 #preferred-modules=
558
559 [tool.pylint.EXCEPTIONS]
560
561 # Exceptions that will emit a warning when being caught. Defaults to
562 # "BaseException, Exception".
563 overgeneral-exceptions="BaseException, Exception"