forked from mosaicml/composer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
1036 lines (820 loc) · 33.4 KB
/
pyproject.toml
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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# build requirements
[build-system]
requires = ["setuptools < 68.0.0"]
build-backend = "setuptools.build_meta"
# iSort
[tool.isort]
multi_line_output = 0
line_length = 120
skip = [ "env", "wandb", "runs", "build", "node_modules" ]
known_third_party = ["wandb"]
# Pyright
[tool.pyright]
include = [
"composer/**",
"tests/**",
"examples/**",
]
exclude = [
"build/**",
"node_modules/**",
]
# Disable checks for missing imports, as a conditional install of composer will not include them
# Any incorrect imports will be discovered through test cases
reportMissingImports="none"
# Sometimes for code validation or readability we want redundant isinstance checks.
reportUnnecessaryIsInstance = "none"
reportMissingTypeStubs = "none"
# forward() and initailize_object() have incompatible method overrides
reportIncompatibleMethodOverride = "none"
reportIncompatibleVariableOverride = "error"
reportUnusedImport = "error"
reportUnusedClass = "error"
reportUnusedFunction = "error"
reportUnusedVariable = "error"
reportDuplicateImport = "error"
reportWildcardImportFromLibrary = "error"
reportUntypedFunctionDecorator = "error"
# Pyright sometimes marks public imports as private
reportPrivateImportUsage = "none"
reportUndefinedVariable = "error"
strictParameterNoneValue = true
reportPropertyTypeMismatch = "error"
reportUntypedNamedTuple = "error"
reportUnnecessaryCast = "error"
reportInvalidTypeVarUse = "error"
reportOverlappingOverload = "error"
reportUninitializedInstanceVariable = "error"
reportInvalidStringEscapeSequence = "error"
reportMissingParameterType = "none" # TODO: make this an error. Many tests are missing parameter types.
reportCallInDefaultInitializer = "error"
reportUnnecessaryComparison = "error"
reportSelfClsParameterName = "error"
# Need to ensure all implict string concatinations are wrapped with an extra set of paranethesis.
reportImplicitStringConcatenation = "none" # TODO: make this an error.
reportInvalidStubStatement = "error"
reportIncompleteStub = "error"
reportUnsupportedDunderAll = "error"
reportUnusedCoroutine = "error"
# Pytest
[tool.pytest.ini_options]
# By default, do not run gpu, vision, docs, notebook, or daily tests
addopts = "--codeblocks --strict-markers -m 'not gpu and not vision and not doctest and not daily and not remote'"
markers = [
# !!!!!!!!!!!IMPORTANT!!!!!!!!!: when updating the markers, also make sure to update meta.yaml
# Tests that require a world_size of two should be annotated with `@pytest.mark.world_size(2)`.
# If not specified, the test will be assumed to have a world-size of one, which is
# equivalent to `@pytest.mark.world_size(1)`
"world_size(val)",
# Tests that require a gpu should be annotated with `@pytest.mark.gpu`
"gpu",
# Whether the test should run in a container based on the vision dockerimage, which contains ffcv and opencv
"vision",
# Tests which are run as part of the documentation build
"doctest",
# Should be run during daily regression
"daily",
# Whether the test will be reading data from a remote source, and may require credentials
"remote",
]
filterwarnings = [
"error", # Mark all warnings as errors
# Treat the warnings that python usually would ignore as warnings, not errors.
"default::DeprecationWarning",
'default::PendingDeprecationWarning',
'default::ImportWarning',
'ignore::ResourceWarning', # Ignore these -- they are from errors like CPU OOMs
# Ignore the following warnings
'ignore:Deterministic mode is activated:UserWarning', # All tests run with deterministic mode
'ignore:SubsetNumBatchesWarning', # SubsetNumBatches is used extensively in testing
# allow training metrics
'ignore:Computing model evaluation metrics during training doubles the number of forward passes:UserWarning',
'ignore:No optimizer was specified.:UserWarning', # OK to not specify an optimizer in the tests
# Ignore a bug in the pytorch dataloader
'''ignore:Exception ignored in. <function _MultiProcessingDataLoaderIter.__del__:pytest.PytestUnraisableExceptionWarning''',
# Ignore torchvision complaining about no c libraries (happens in the conda build)
'ignore:Failed to load image Python extension:UserWarning',
# Ignore a deprecation warning in the conda build
'ignore:distutils Version classes are deprecated:DeprecationWarning',
# Ignore a UserWarning from TorchMetrics about potentially large memory usage when batch sizes are extremely large
'ignore:Metric `SpearmanCorrcoef` will save all targets and predictions in the buffer:UserWarning:torchmetrics',
# Ignore a UserWarning from torch 1.12 due to DeepSpeed's use of positional args
'ignore:Positional args are being deprecated, use kwargs instead.*:UserWarning',
'ignore:torch.distributed._all_gather_base is a private function and will be deprecated.*:UserWarning',
'ignore:torch.distributed._reduce_scatter_base is a private function and will be deprecated.*:UserWarning',
# Ignore tensorboard deprecation warnings
'ignore:Call to deprecated create function Descriptor().*:DeprecationWarning:tensorboard',
'ignore:Call to deprecated create function EnumDescriptor().*:DeprecationWarning:tensorboard',
'ignore:Call to deprecated create function EnumValueDescriptor().*:DeprecationWarning:tensorboard',
'ignore:Call to deprecated create function FieldDescriptor().*:DeprecationWarning:tensorboard',
'ignore:Call to deprecated create function FileDescriptor().*:DeprecationWarning:tensorboard',
# Ignore TracerWarnings for operations potentially unsupported by model tracing
'ignore:.*might cause the trace to be incorrect.*:Warning',
]
# Coverage
[tool.coverage.run]
parallel = true
branch = true
relative_files = true
concurrency = ["thread"]
include = [
"composer/*"
]
# Yapf
[tool.yapf]
# Align closing bracket with visual indentation.
align_closing_bracket_with_visual_indent = false
# Allow dictionary keys to exist on multiple lines. For example:
#
# x = {
# ('this is the first element of a tuple',
# 'this is the second element of a tuple'):
# value,
# }
allow_multiline_dictionary_keys = false
# Allow lambdas to be formatted on more than one line.
allow_multiline_lambdas = false
# Allow splitting before a default / named assignment in an argument list.
allow_split_before_default_or_named_assigns = true
# Allow splits before the dictionary value.
allow_split_before_dict_value = true
# Let spacing indicate operator precedence. For example:
#
# a = 1 * 2 + 3 / 4
# b = 1 / 2 - 3 * 4
# c = (1 + 2) * (3 - 4)
# d = (1 - 2) / (3 + 4)
# e = 1 * 2 - 3
# f = 1 + 2 + 3 + 4
#
# will be formatted as follows to indicate precedence:
#
# a = 1*2 + 3/4
# b = 1/2 - 3*4
# c = (1+2) * (3-4)
# d = (1-2) / (3+4)
# e = 1*2 - 3
# f = 1 + 2 + 3 + 4
#
arithmetic_precedence_indication = false
# Number of blank lines surrounding top-level function and class
# definitions.
blank_lines_around_top_level_definition = 2
# Insert a blank line before a class-level docstring.
blank_line_before_class_docstring = false
# Insert a blank line before a module docstring.
blank_line_before_module_docstring = true
# Insert a blank line before a 'def' or 'class' immediately nested
# within another 'def' or 'class'. For example:
#
# class Foo:
# # <------ this blank line
# def method():
# ...
blank_line_before_nested_class_or_def = true
# Do not split consecutive brackets. Only relevant when
# dedent_closing_brackets is set. For example:
#
# call_func_that_takes_a_dict(
# {
# 'key1': 'value1',
# 'key2': 'value2',
# }
# )
#
# would reformat to:
#
# call_func_that_takes_a_dict({
# 'key1': 'value1',
# 'key2': 'value2',
# })
coalesce_brackets = false
# The column limit.
column_limit = 120
# The style for continuation alignment. Possible values are:
#
# - SPACE: Use spaces for continuation alignment. This is default behavior.
# - FIXED: Use fixed number (CONTINUATION_INDENT_WIDTH) of columns
# (ie: CONTINUATION_INDENT_WIDTH/INDENT_WIDTH tabs or
# CONTINUATION_INDENT_WIDTH spaces) for continuation alignment.
# - VALIGN-RIGHT: Vertically align continuation lines to multiple of
# INDENT_WIDTH columns. Slightly right (one tab or a few spaces) if
# cannot vertically align continuation lines with indent characters.
continuation_align_style = 'SPACE'
# Indent width used for line continuations.
continuation_indent_width = 4
# Put closing brackets on a separate line, dedented, if the bracketed
# expression can't fit in a single line. Applies to all kinds of brackets,
# including function definitions and calls. For example:
#
# config = {
# 'key1': 'value1',
# 'key2': 'value2',
# } # <--- this bracket is dedented and on a separate line
#
# time_series = self.remote_client.query_entity_counters(
# entity='dev3246.region1',
# key='dns.query_latency_tcp',
# transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
# start_ts=now()-timedelta(days=3),
# end_ts=now(),
# ) # <--- this bracket is dedented and on a separate line
dedent_closing_brackets = false
# Disable the heuristic which places each list element on a separate line
# if the list is comma-terminated.
disable_ending_comma_heuristic = false
# Place each dictionary entry onto its own line.
each_dict_entry_on_separate_line = true
# Require multiline dictionary even if it would normally fit on one line.
# For example:
#
# config = {
# 'key1': 'value1'
# }
force_multiline_dict = false
# The regex for an i18n comment. The presence of this comment stops
# reformatting of that line, because the comments are required to be
# next to the string they translate.
i18n_comment = '#\..*'
# The i18n function call names. The presence of this function stops
# reformattting on that line, because the string it has cannot be moved
# away from the i18n comment.
i18n_function_call = 'N_, _'
# Indent blank lines.
indent_blank_lines = false
# Put closing brackets on a separate line, indented, if the bracketed
# expression can't fit in a single line. Applies to all kinds of brackets,
# including function definitions and calls. For example:
#
# config = {
# 'key1': 'value1',
# 'key2': 'value2',
# } # <--- this bracket is indented and on a separate line
#
# time_series = self.remote_client.query_entity_counters(
# entity='dev3246.region1',
# key='dns.query_latency_tcp',
# transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
# start_ts=now()-timedelta(days=3),
# end_ts=now(),
# ) # <--- this bracket is indented and on a separate line
indent_closing_brackets = false
# Indent the dictionary value if it cannot fit on the same line as the
# dictionary key. For example:
#
# config = {
# 'key1':
# 'value1',
# 'key2': value1 +
# value2,
# }
indent_dictionary_value = true
# The number of columns to use for indentation.
indent_width = 4
# Join short lines into one line. E.g., single line 'if' statements.
join_multiple_lines = false
# Do not include spaces around selected binary operators. For example:
#
# 1 + 2 * 3 - 4 / 5
#
# will be formatted as follows when configured with "*,/":
#
# 1 + 2*3 - 4/5
no_spaces_around_selected_binary_operators = ''
# Use spaces around default or named assigns.
spaces_around_default_or_named_assign = false
# Adds a space after the opening '{' and before the ending '}' dict delimiters.
#
# {1: 2}
#
# will be formatted as:
#
# { 1: 2 }
spaces_around_dict_delimiters = false
# Adds a space after the opening '[' and before the ending ']' list delimiters.
#
# [1, 2]
#
# will be formatted as:
#
# [ 1, 2 ]
spaces_around_list_delimiters = false
# Use spaces around the power operator.
spaces_around_power_operator = false
# Use spaces around the subscript / slice operator. For example:
#
# my_list[1 : 10 : 2]
spaces_around_subscript_colon = false
# Adds a space after the opening '(' and before the ending ')' tuple delimiters.
#
# (1, 2, 3)
#
# will be formatted as:
#
# ( 1, 2, 3 )
spaces_around_tuple_delimiters = false
# The number of spaces required before a trailing comment.
# This can be a single value (representing the number of spaces
# before each trailing comment) or list of values (representing
# alignment column values; trailing comments within a block will
# be aligned to the first column value that is greater than the maximum
# line length within the block). For example:
#
# With spaces_before_comment=5:
#
# 1 + 1 # Adding values
#
# will be formatted as:
#
# 1 + 1 # Adding values <-- 5 spaces between the end of the statement and comment
#
# With spaces_before_comment = '15, 20:'
#
# 1 + 1 # Adding values
# two + two # More adding
#
# longer_statement # This is a longer statement
# short # This is a shorter statement
#
# a_very_long_statement_that_extends_beyond_the_final_column # Comment
# short # This is a shorter statement
#
# will be formatted as:
#
# 1 + 1 # Adding values <-- end of line comments in block aligned to col 15
# two + two # More adding
#
# longer_statement # This is a longer statement <-- end of line comments in block aligned to col 20
# short # This is a shorter statement
#
# a_very_long_statement_that_extends_beyond_the_final_column # Comment <-- the end of line comments are aligned based on the line length
# short # This is a shorter statement
#
spaces_before_comment = 2
# Insert a space between the ending comma and closing bracket of a list,
# etc.
space_between_ending_comma_and_closing_bracket = false
# Use spaces inside brackets, braces, and parentheses. For example:
#
# method_call( 1 )
# my_dict[ 3 ][ 1 ][ get_index( *args, **kwargs ) ]
# my_set = { 1, 2, 3 }
space_inside_brackets = false
# Split before arguments
split_all_comma_separated_values = false
# Split before arguments, but do not split all subexpressions recursively
# (unless needed).
split_all_top_level_comma_separated_values = false
# Split before arguments if the argument list is terminated by a
# comma.
split_arguments_when_comma_terminated = false
# Set to True to prefer splitting before '+', '-', '*', '/', '//', or '@'
# rather than after.
split_before_arithmetic_operator = false
# Set to True to prefer splitting before '&', '|' or '^' rather than
# after.
split_before_bitwise_operator = false
# Split before the closing bracket if a list or dict literal doesn't fit on
# a single line.
split_before_closing_bracket = true
# Split before a dictionary or set generator (comp_for). For example, note
# the split before the 'for':
#
# foo = {
# variable: 'Hello world, have a nice day!'
# for variable in bar if variable != 42
# }
split_before_dict_set_generator = false
# Split before the '.' if we need to split a longer expression:
#
# foo = ('This is a really long string: {}, {}, {}, {}'.format(a, b, c, d))
#
# would reformat to something like:
#
# foo = ('This is a really long string: {}, {}, {}, {}'
# .format(a, b, c, d))
split_before_dot = false
# Split after the opening paren which surrounds an expression if it doesn't
# fit on a single line.
split_before_expression_after_opening_paren = false
# If an argument / parameter list is going to be split, then split before
# the first argument.
split_before_first_argument = false
# Set to True to prefer splitting before 'and' or 'or' rather than
# after.
split_before_logical_operator = false
# Split named assignments onto individual lines.
split_before_named_assigns = true
# Set to True to split list comprehensions and generators that have
# non-trivial expressions and multiple clauses before each of these
# clauses. For example:
#
# result = [
# a_long_var + 100 for a_long_var in xrange(1000)
# if a_long_var % 10]
#
# would reformat to something like:
#
# result = [
# a_long_var + 100
# for a_long_var in xrange(1000)
# if a_long_var % 10]
split_complex_comprehension = true
# The penalty for splitting right after the opening bracket.
split_penalty_after_opening_bracket = 300
# The penalty for splitting the line after a unary operator.
split_penalty_after_unary_operator = 10000
# The penalty of splitting the line around the '+', '-', '*', '/', '//',
# ``%``, and '@' operators.
split_penalty_arithmetic_operator = 300
# The penalty for splitting right before an if expression.
split_penalty_before_if_expr = 0
# The penalty of splitting the line around the '&', '|', and '^'
# operators.
split_penalty_bitwise_operator = 300
# The penalty for splitting a list comprehension or generator
# expression.
split_penalty_comprehension = 2100
# The penalty for characters over the column limit.
split_penalty_excess_character = 7000
# The penalty incurred by adding a line split to the unwrapped line. The
# more line splits added the higher the penalty.
split_penalty_for_added_line_split = 20
# The penalty of splitting a list of "import as" names. For example:
#
# from a_very_long_or_indented_module_name_yada_yad import (long_argument_1,
# long_argument_2,
# long_argument_3)
#
# would reformat to something like:
#
# from a_very_long_or_indented_module_name_yada_yad import (
# long_argument_1, long_argument_2, long_argument_3)
split_penalty_import_names = 0
# The penalty of splitting the line around the 'and' and 'or'
# operators.
split_penalty_logical_operator = 300
# Use the Tab character for indentation.
use_tabs = false
# Ignore directories
[tool.yapfignore]
ignore_patterns = [
"runs/**/*.py",
"wandb/**/*.py",
"build/**/*.py",
]
[tool.pylint.MASTER]
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-allow-list=""
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
# for backward compatibility.)
extension-pkg-whitelist=""
# Return non-zero exit code if any of these messages/categories are detected,
# even if score is above --fail-under value. Syntax same as enable. Messages
# specified are enabled, while categories only check already-enabled messages.
fail-on=""
# Specify a score threshold to be exceeded before program exits with error.
# fail-under=10.0
# Files or directories to be skipped. They should be base names, not paths.
ignore="CVS"
# Add files or directories matching the regex patterns to the ignore-list. The
# regex matches against paths and can be in Posix or Windows format.
ignore-paths=""
# Files or directories matching the regex patterns are skipped. The regex
# matches against base names, not paths.
ignore-patterns=""
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
init-hook=""
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use.
jobs=4
# Control the amount of potential inferred values when inferring a single
# object. This can help the performance when dealing with large functions or
# complex, nested conditions.
limit-inference-results=100
# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
# load-plugins=
# Pickle collected data for later comparisons.
# persistent=yes
# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.9
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode="yes"
# 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.'MESSAGES CONTROL']
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
confidence=""
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once). You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable="""raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
similarities,
typecheck,
design,
missing-module-docstring,
wrong-import-position,
use-symbolic-message-instead,
arguments-differ,
import-outside-toplevel,
too-many-nested-block,
signature-differs,
useless-import-alias"""
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
enable="c-extension-no-member"
[tool.pylint.'REPORTS']
# Python expression which should return a score less than or equal to 10. You
# have access to the variables 'error', 'warning', 'refactor', and 'convention'
# which contain the number of messages in each category, as well as 'statement'
# which is the total number of statements analyzed. This score is used by the
# global evaluation report (RP0004).
# evaluation="10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)"
# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details.
#msg-template=
# Set the output format. Available formats are text, parseable, colorized, json
# and msvs (visual studio). You can also give a reporter class, e.g.
# mypackage.mymodule.MyReporterClass.
output-format="colorized"
# Tells whether to display a full report or only the messages.
reports="no"
# Activate the evaluation score.
score="no"
[tool.pylint.REFACTORING]
# Maximum number of nested blocks for function / method body
max-nested-blocks=10
# 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"
[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="no"
# This flag controls whether the implicit-str-concat should generate a warning
# on implicit string concatenation in sequences defined over several lines.
check-str-concat-over-line-jumps="no"
[tool.pylint.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"
[tool.pylint.VARIABLES]
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid defining new builtins when possible.
additional-builtins=""
# Tells whether unused global variables should be treated as a violation.
allow-global-unused-variables="yes"
# List of names allowed to shadow builtins
allowed-redefined-builtins=""
# 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"
# A regular expression matching the name of dummy variables (i.e. expected to
# not be used).
dummy-variables-rgx="_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_"
# Argument names that match this expression will be ignored. Default to name
# with leading underscore.
ignored-argument-names="_.*|^ignored_|^unused_"
# Tells whether we should check for unused import in __init__ files.
init-import="no"
# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules="six.moves,past.builtins,future.builtins,builtins,io"
[tool.pylint.MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=""
# Regular expression of note tags to take in consideration.
#notes-rgx=
[tool.pylint.SPELLING]
# Limits count of emitted suggestions for spelling mistakes.
max-spelling-suggestions=4
# Spelling dictionary name. Available dictionaries: none. To make it work,
# install the 'python-enchant' package.
spelling-dict=""
# List of comma separated words that should be considered directives if they
# appear and the beginning of a comment and should not be checked.
spelling-ignore-comment-directives="fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:,pyright:,type:"
# List of comma separated words that should not be checked.
spelling-ignore-words=""
# A path to a file that contains the private dictionary; one word per line.
spelling-private-dict-file=""
# Tells whether to store unknown words to the private dictionary (see the
# --spelling-private-dict-file option) instead of raising a message.
spelling-store-unknown-words="no"
[tool.pylint.BASIC]
# Naming style matching correct argument names.
argument-naming-style="snake_case"
# Regular expression matching correct argument names. Overrides argument-
# naming-style.
#argument-rgx=
# Naming style matching correct attribute names.
attr-naming-style="snake_case"
# Regular expression matching correct attribute names. Overrides attr-naming-
# style.
#attr-rgx=
# Bad variable names which should always be refused, separated by a comma.
bad-names=""
# Bad variable names regexes, separated by a comma. If names match any regex,
# they will always be refused
bad-names-rgxs=""
# Naming style matching correct class attribute names.
class-attribute-naming-style="any"
# Regular expression matching correct class attribute names. Overrides class-
# attribute-naming-style.
#class-attribute-rgx=
# Naming style matching correct class constant names.
class-const-naming-style="UPPER_CASE"
# Regular expression matching correct class constant names. Overrides class-
# const-naming-style.
#class-const-rgx=
# Naming style matching correct class names.
class-naming-style="PascalCase"
# Regular expression matching correct class names. Overrides class-naming-
# style.
#class-rgx=
# Naming style matching correct constant names.
const-naming-style="UPPER_CASE"
# Regular expression matching correct constant names. Overrides const-naming-
# style.
#const-rgx=
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
# Naming style matching correct function names.
function-naming-style="snake_case"
# Regular expression matching correct function names. Overrides function-
# naming-style.
#function-rgx=
# Good variable names which should always be accepted, separated by a comma.
good-names=""
# Good variable names regexes, separated by a comma. If names match any regex,
# they will always be accepted
good-names-rgxs="^[_a-z][_a-z0-9]*$"
# Include a hint for the correct naming format with invalid-name.
include-naming-hint="no"
# Naming style matching correct inline iteration names.
inlinevar-naming-style="any"
# Regular expression matching correct inline iteration names. Overrides
# inlinevar-naming-style.
#inlinevar-rgx=
# Naming style matching correct method names.
method-naming-style="snake_case"
# Regular expression matching correct method names. Overrides method-naming-
# style.
#method-rgx=
# Naming style matching correct module names.
module-naming-style="snake_case"
# Regular expression matching correct module names. Overrides module-naming-
# style.
#module-rgx=
# Colon-delimited sets of names that determine each other's naming style when
# the name regexes allow several styles.
name-group=""
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx="^_"
# 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"
# Naming style matching correct variable names.
variable-naming-style="snake_case"
# Regular expression matching correct variable names. Overrides variable-
# naming-style.
#variable-rgx=
[tool.pylint.SIMILARITIES]
# Comments are removed from the similarity computation
ignore-comments="yes"
# Docstrings are removed from the similarity computation
ignore-docstrings="yes"
# Imports are removed from the similarity computation
ignore-imports="no"
# Signatures are removed from the similarity computation
ignore-signatures="no"
# Minimum lines number of a similarity.
min-similarity-lines=4
[tool.pylint.FORMAT]
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
expected-line-ending-format=""
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines="^\\s*(# )?<?https?:\\/\\/\\S+>?$"
# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren=4
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
# Maximum number of characters on a single line.
max-line-length=120
# Maximum number of lines in a module.
# max-module-lines=1000
# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt="no"
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt="no"
[tool.pylint.IMPORTS]
# List of modules that can be imported at any level, not just the top level
# one.
allow-any-import-level=""
# Allow wildcard imports from modules that define __all__.
allow-wildcard-with-all="no"
# 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"
# Deprecated modules which should not be used, separated by a comma.
deprecated-modules=""
# Output a graph (.gv or any supported image format) of external dependencies
# to the given file (report RP0402 must not be disabled).
ext-import-graph=""
# Output a graph (.gv or any supported image format) of all (i.e. internal and
# external) dependencies to the given file (report RP0402 must not be
# disabled).
import-graph=""
# Output a graph (.gv or any supported image format) of internal dependencies
# to the given file (report RP0402 must not be disabled).
int-import-graph=""
# Force import order to recognize a module as part of the standard
# compatibility libraries.
known-standard-library=""
# Force import order to recognize a module as part of a third party library.
known-third-party="enchant"
# Couples of modules and preferred modules, separated by a comma.
preferred-modules=""
[tool.pylint.CLASSES]
# Warn about protected attribute access inside special methods
check-protected-access-in-special-methods="no"
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods="__init__,__new__,setUp,__post_init__"
# 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"
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg="cls"
[tool.pylint.DESIGN]
# List of regular expressions of class ancestor names to ignore when counting
# public methods (see R0903)
exclude-too-few-public-methods=""
# List of qualified class names to ignore when counting class parents (see
# R0901)
ignored-parents=""
# Maximum number of arguments for function / method.
max-args=5
# Maximum number of attributes for a class (see R0902).
max-attributes=7