.pylintrc 21 KB

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