pylintrc.toml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. # -*- coding: utf-8; mode: conf-toml -*-
  2. [tool.pylint.main]
  3. # Analyse import fallback blocks. This can be used to support both Python 2 and 3
  4. # compatible code, which means that the block might have code that exists only in
  5. # one or another interpreter, leading to false positives when analysed.
  6. # analyse-fallback-blocks =
  7. # Clear in-memory caches upon conclusion of linting. Useful if running pylint in
  8. # a server-like mode.
  9. # clear-cache-post-run =
  10. # Always return a 0 (non-error) status code, even if lint errors are found. This
  11. # is primarily useful in continuous integration scripts.
  12. # exit-zero =
  13. # A comma-separated list of package or module names from where C extensions may
  14. # be loaded. Extensions are loading into the active Python interpreter and may
  15. # run arbitrary code.
  16. # extension-pkg-allow-list =
  17. # A comma-separated list of package or module names from where C extensions may
  18. # be loaded. Extensions are loading into the active Python interpreter and may
  19. # run arbitrary code. (This is an alternative name to extension-pkg-allow-list
  20. # for backward compatibility.)
  21. # extension-pkg-whitelist =
  22. # Return non-zero exit code if any of these messages/categories are detected,
  23. # even if score is above --fail-under value. Syntax same as enable. Messages
  24. # specified are enabled, while categories only check already-enabled messages.
  25. # fail-on =
  26. # Specify a score threshold under which the program will exit with error.
  27. fail-under = 10
  28. # Interpret the stdin as a python script, whose filename needs to be passed as
  29. # the module_or_package argument.
  30. # from-stdin =
  31. # Files or directories to be skipped. They should be base names, not paths.
  32. ignore = ["CVS"]
  33. # Add files or directories matching the regular expressions patterns to the
  34. # ignore-list. The regex matches against paths and can be in Posix or Windows
  35. # format. Because '\\' represents the directory delimiter on Windows systems, it
  36. # can't be used as an escape character.
  37. # ignore-paths =
  38. # Files or directories matching the regular expression patterns are skipped. The
  39. # regex matches against base names, not paths. The default value ignores Emacs
  40. # file locks
  41. ignore-patterns = ["^\\.#"]
  42. # List of module names for which member attributes should not be checked and will
  43. # not be imported (useful for modules/projects where namespaces are manipulated
  44. # during runtime and thus existing member attributes cannot be deduced by static
  45. # analysis). It supports qualified module names, as well as Unix pattern
  46. # matching.
  47. # ignored-modules =
  48. # Python code to execute, usually for sys.path manipulation such as
  49. # pygtk.require().
  50. # init-hook =
  51. # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
  52. # number of processors available to use, and will cap the count on Windows to
  53. # avoid hangs.
  54. jobs = 1
  55. # Control the amount of potential inferred values when inferring a single object.
  56. # This can help the performance when dealing with large functions or complex,
  57. # nested conditions.
  58. limit-inference-results = 100
  59. # List of plugins (as comma separated values of python module names) to load,
  60. # usually to register additional checkers.
  61. # load-plugins =
  62. # Pickle collected data for later comparisons.
  63. persistent = true
  64. # Resolve imports to .pyi stubs if available. May reduce no-member messages and
  65. # increase not-an-iterable messages.
  66. # prefer-stubs =
  67. # Minimum Python version to use for version dependent checks. Will default to the
  68. # version used to run pylint.
  69. py-version = "3.10"
  70. # Discover python modules and packages in the file system subtree.
  71. # recursive =
  72. # Add paths to the list of the source roots. Supports globbing patterns. The
  73. # source root is an absolute path or a path relative to the current working
  74. # directory used to determine a package namespace for modules located under the
  75. # source root.
  76. # source-roots =
  77. # When enabled, pylint would attempt to guess common misconfiguration and emit
  78. # user-friendly hints instead of false-positive error messages.
  79. suggestion-mode = true
  80. # Allow loading of arbitrary C extensions. Extensions are imported into the
  81. # active Python interpreter and may run arbitrary code.
  82. # unsafe-load-any-extension =
  83. [tool.pylint.basic]
  84. # Naming style matching correct argument names.
  85. argument-naming-style = "snake_case"
  86. # Regular expression matching correct argument names. Overrides argument-naming-
  87. # style. If left empty, argument names will be checked with the set naming style.
  88. # argument-rgx =
  89. # Naming style matching correct attribute names.
  90. attr-naming-style = "snake_case"
  91. # Regular expression matching correct attribute names. Overrides attr-naming-
  92. # style. If left empty, attribute names will be checked with the set naming
  93. # style.
  94. # attr-rgx =
  95. # Bad variable names which should always be refused, separated by a comma.
  96. bad-names = ["foo", "bar", "baz", "toto", "tutu", "tata"]
  97. # Bad variable names regexes, separated by a comma. If names match any regex,
  98. # they will always be refused
  99. # bad-names-rgxs =
  100. # Naming style matching correct class attribute names.
  101. class-attribute-naming-style = "any"
  102. # Regular expression matching correct class attribute names. Overrides class-
  103. # attribute-naming-style. If left empty, class attribute names will be checked
  104. # with the set naming style.
  105. # class-attribute-rgx =
  106. # Naming style matching correct class constant names.
  107. class-const-naming-style = "UPPER_CASE"
  108. # Regular expression matching correct class constant names. Overrides class-
  109. # const-naming-style. If left empty, class constant names will be checked with
  110. # the set naming style.
  111. # class-const-rgx =
  112. # Naming style matching correct class names.
  113. class-naming-style = "PascalCase"
  114. # Regular expression matching correct class names. Overrides class-naming-style.
  115. # If left empty, class names will be checked with the set naming style.
  116. # class-rgx =
  117. # Naming style matching correct constant names.
  118. const-naming-style = "UPPER_CASE"
  119. # Regular expression matching correct constant names. Overrides const-naming-
  120. # style. If left empty, constant names will be checked with the set naming style.
  121. # const-rgx =
  122. # Minimum line length for functions/classes that require docstrings, shorter ones
  123. # are exempt.
  124. docstring-min-length = -1
  125. # Naming style matching correct function names.
  126. function-naming-style = "snake_case"
  127. # Regular expression matching correct function names. Overrides function-naming-
  128. # style. If left empty, function names will be checked with the set naming style.
  129. # function-rgx =
  130. # Good variable names which should always be accepted, separated by a comma.
  131. good-names = ["i", "j", "k", "ex", "Run", "_"]
  132. # Good variable names regexes, separated by a comma. If names match any regex,
  133. # they will always be accepted
  134. # good-names-rgxs =
  135. # Include a hint for the correct naming format with invalid-name.
  136. # include-naming-hint =
  137. # Naming style matching correct inline iteration names.
  138. inlinevar-naming-style = "any"
  139. # Regular expression matching correct inline iteration names. Overrides
  140. # inlinevar-naming-style. If left empty, inline iteration names will be checked
  141. # with the set naming style.
  142. # inlinevar-rgx =
  143. # Naming style matching correct method names.
  144. method-naming-style = "snake_case"
  145. # Regular expression matching correct method names. Overrides method-naming-
  146. # style. If left empty, method names will be checked with the set naming style.
  147. # method-rgx =
  148. # Naming style matching correct module names.
  149. module-naming-style = "snake_case"
  150. # Regular expression matching correct module names. Overrides module-naming-
  151. # style. If left empty, module names will be checked with the set naming style.
  152. # module-rgx =
  153. # Colon-delimited sets of names that determine each other's naming style when the
  154. # name regexes allow several styles.
  155. # name-group =
  156. # Regular expression which should only match function or class names that do not
  157. # require a docstring.
  158. no-docstring-rgx = "^_"
  159. # List of decorators that produce properties, such as abc.abstractproperty. Add
  160. # to this list to register other decorators that produce valid properties. These
  161. # decorators are taken in consideration only for invalid-name.
  162. property-classes = ["abc.abstractproperty"]
  163. # Regular expression matching correct type alias names. If left empty, type alias
  164. # names will be checked with the set naming style.
  165. # typealias-rgx =
  166. # Regular expression matching correct type variable names. If left empty, type
  167. # variable names will be checked with the set naming style.
  168. # typevar-rgx =
  169. # Naming style matching correct variable names.
  170. variable-naming-style = "snake_case"
  171. # Regular expression matching correct variable names. Overrides variable-naming-
  172. # style. If left empty, variable names will be checked with the set naming style.
  173. # variable-rgx =
  174. [tool.pylint.classes]
  175. # Warn about protected attribute access inside special methods
  176. # check-protected-access-in-special-methods =
  177. # List of method names used to declare (i.e. assign) instance attributes.
  178. defining-attr-methods = ["__init__", "__new__", "setUp", "asyncSetUp", "__post_init__"]
  179. # List of member names, which should be excluded from the protected access
  180. # warning.
  181. exclude-protected = ["_asdict", "_fields", "_replace", "_source", "_make", "os._exit"]
  182. # List of valid names for the first argument in a class method.
  183. valid-classmethod-first-arg = ["cls"]
  184. # List of valid names for the first argument in a metaclass class method.
  185. valid-metaclass-classmethod-first-arg = ["mcs"]
  186. [tool.pylint.design]
  187. # List of regular expressions of class ancestor names to ignore when counting
  188. # public methods (see R0903)
  189. # exclude-too-few-public-methods =
  190. # List of qualified class names to ignore when counting class parents (see R0901)
  191. # ignored-parents =
  192. # Maximum number of arguments for function / method.
  193. max-args = 5
  194. # Maximum number of attributes for a class (see R0902).
  195. max-attributes = 7
  196. # Maximum number of boolean expressions in an if statement (see R0916).
  197. max-bool-expr = 5
  198. # Maximum number of branch for function / method body.
  199. max-branches = 12
  200. # Maximum number of locals for function / method body.
  201. max-locals = 15
  202. # Maximum number of parents for a class (see R0901).
  203. max-parents = 7
  204. # Maximum number of positional arguments for function / method.
  205. max-positional-arguments = 5
  206. # Maximum number of public methods for a class (see R0904).
  207. max-public-methods = 20
  208. # Maximum number of return / yield for function / method body.
  209. max-returns = 6
  210. # Maximum number of statements in function / method body.
  211. max-statements = 50
  212. # Minimum number of public methods for a class (see R0903).
  213. min-public-methods = 2
  214. [tool.pylint.exceptions]
  215. # Exceptions that will emit a warning when caught.
  216. overgeneral-exceptions = ["builtins.BaseException", "builtins.Exception"]
  217. [tool.pylint.format]
  218. # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
  219. # expected-line-ending-format =
  220. # Regexp for a line that is allowed to be longer than the limit.
  221. ignore-long-lines = "^\\s*(# )?<?https?://\\S+>?$"
  222. # Number of spaces of indent required inside a hanging or continued line.
  223. indent-after-paren = 4
  224. # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
  225. # tab).
  226. indent-string = " "
  227. # Maximum number of characters on a single line.
  228. max-line-length = 120
  229. # Maximum number of lines in a module.
  230. max-module-lines = 2000
  231. # Allow the body of a class to be on the same line as the declaration if body
  232. # contains single statement.
  233. # single-line-class-stmt =
  234. # Allow the body of an if to be on the same line as the test if there is no else.
  235. # single-line-if-stmt =
  236. [tool.pylint.imports]
  237. # List of modules that can be imported at any level, not just the top level one.
  238. # allow-any-import-level =
  239. # Allow explicit reexports by alias from a package __init__.
  240. # allow-reexport-from-package =
  241. # Allow wildcard imports from modules that define __all__.
  242. # allow-wildcard-with-all =
  243. # Deprecated modules which should not be used, separated by a comma.
  244. # deprecated-modules =
  245. # Output a graph (.gv or any supported image format) of external dependencies to
  246. # the given file (report RP0402 must not be disabled).
  247. # ext-import-graph =
  248. # Output a graph (.gv or any supported image format) of all (i.e. internal and
  249. # external) dependencies to the given file (report RP0402 must not be disabled).
  250. # import-graph =
  251. # Output a graph (.gv or any supported image format) of internal dependencies to
  252. # the given file (report RP0402 must not be disabled).
  253. # int-import-graph =
  254. # Force import order to recognize a module as part of the standard compatibility
  255. # libraries.
  256. # known-standard-library =
  257. # Force import order to recognize a module as part of a third party library.
  258. known-third-party = ["enchant"]
  259. # Couples of modules and preferred modules, separated by a comma.
  260. # preferred-modules =
  261. [tool.pylint.logging]
  262. # The type of string formatting that logging methods do. `old` means using %
  263. # formatting, `new` is for `{}` formatting.
  264. logging-format-style = "new"
  265. # Logging modules to check that the string format arguments are in logging
  266. # function parameter format.
  267. logging-modules = ["logging"]
  268. [tool.pylint."messages control"]
  269. # Only show warnings with the listed confidence levels. Leave empty to show all.
  270. # Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
  271. confidence = ["HIGH", "CONTROL_FLOW", "INFERENCE", "INFERENCE_FAILURE", "UNDEFINED"]
  272. # Disable the message, report, category or checker with the given id(s). You can
  273. # either give multiple identifiers separated by comma (,) or put this option
  274. # multiple times (only on the command line, not in the configuration file where
  275. # it should appear only once). You can also use "--disable=all" to disable
  276. # everything first and then re-enable specific checks. For example, if you want
  277. # to run only the similarities checker, you can use "--disable=all
  278. # --enable=similarities". If you want to run only the classes checker, but have
  279. # no Warning level messages displayed, use "--disable=all --enable=classes
  280. # --disable=W".
  281. disable = [
  282. "raw-checker-failed",
  283. "bad-inline-option",
  284. "locally-disabled",
  285. "file-ignored",
  286. "suppressed-message",
  287. "useless-suppression",
  288. "deprecated-pragma",
  289. "use-implicit-booleaness-not-comparison-to-string",
  290. "use-implicit-booleaness-not-comparison-to-zero",
  291. "use-symbolic-message-instead",
  292. "too-few-public-methods",
  293. "logging-fstring-interpolation",
  294. "duplicate-code",
  295. ]
  296. # Enable the message, report, category or checker with the given id(s). You can
  297. # either give multiple identifier separated by comma (,) or put this option
  298. # multiple time (only on the command line, not in the configuration file where it
  299. # should appear only once). See also the "--disable" option for examples.
  300. # enable =
  301. [tool.pylint.method_args]
  302. # List of qualified names (i.e., library.method) which require a timeout
  303. # parameter e.g. 'requests.api.get,requests.api.post'
  304. timeout-methods = [
  305. "requests.api.delete",
  306. "requests.api.get",
  307. "requests.api.head",
  308. "requests.api.options",
  309. "requests.api.patch",
  310. "requests.api.post",
  311. "requests.api.put",
  312. "requests.api.request"
  313. ]
  314. [tool.pylint.miscellaneous]
  315. # List of note tags to take in consideration, separated by a comma.
  316. notes = ["FIXME", "XXX", "TODO"]
  317. # Regular expression of note tags to take in consideration.
  318. # notes-rgx =
  319. [tool.pylint.refactoring]
  320. # Maximum number of nested blocks for function / method body
  321. max-nested-blocks = 5
  322. # Complete name of functions that never returns. When checking for inconsistent-
  323. # return-statements if a never returning function is called then it will be
  324. # considered as an explicit return statement and no message will be printed.
  325. never-returning-functions = ["sys.exit", "argparse.parse_error"]
  326. # Let 'consider-using-join' be raised when the separator to join on would be non-
  327. # empty (resulting in expected fixes of the type: ``"- " + " - ".join(items)``)
  328. suggest-join-with-non-empty-separator = true
  329. [tool.pylint.reports]
  330. # Python expression which should return a score less than or equal to 10. You
  331. # have access to the variables 'fatal', 'error', 'warning', 'refactor',
  332. # 'convention', and 'info' which contain the number of messages in each category,
  333. # as well as 'statement' which is the total number of statements analyzed. This
  334. # score is used by the global evaluation report (RP0004).
  335. evaluation = "max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))"
  336. # Template used to display messages. This is a python new-style format string
  337. # used to format the message information. See doc for all details.
  338. # msg-template =
  339. # Set the output format. Available formats are: text, parseable, colorized, json2
  340. # (improved json format), json (old json format) and msvs (visual studio). You
  341. # can also give a reporter class, e.g. mypackage.mymodule.MyReporterClass.
  342. # output-format =
  343. # Tells whether to display a full report or only the messages.
  344. # reports =
  345. # Activate the evaluation score.
  346. score = true
  347. [tool.pylint.similarities]
  348. # Comments are removed from the similarity computation
  349. ignore-comments = true
  350. # Docstrings are removed from the similarity computation
  351. ignore-docstrings = true
  352. # Imports are removed from the similarity computation
  353. ignore-imports = true
  354. # Signatures are removed from the similarity computation
  355. ignore-signatures = true
  356. # Minimum lines number of a similarity.
  357. min-similarity-lines = 4
  358. [tool.pylint.spelling]
  359. # Limits count of emitted suggestions for spelling mistakes.
  360. max-spelling-suggestions = 4
  361. # Spelling dictionary name. No available dictionaries : You need to install both
  362. # the python package and the system dependency for enchant to work.
  363. # spelling-dict =
  364. # List of comma separated words that should be considered directives if they
  365. # appear at the beginning of a comment and should not be checked.
  366. spelling-ignore-comment-directives = "fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:"
  367. # List of comma separated words that should not be checked.
  368. # spelling-ignore-words =
  369. # A path to a file that contains the private dictionary; one word per line.
  370. # spelling-private-dict-file =
  371. # Tells whether to store unknown words to the private dictionary (see the
  372. # --spelling-private-dict-file option) instead of raising a message.
  373. # spelling-store-unknown-words =
  374. [tool.pylint.typecheck]
  375. # List of decorators that produce context managers, such as
  376. # contextlib.contextmanager. Add to this list to register other decorators that
  377. # produce valid context managers.
  378. contextmanager-decorators = ["contextlib.contextmanager"]
  379. # List of members which are set dynamically and missed by pylint inference
  380. # system, and so shouldn't trigger E1101 when accessed. Python regular
  381. # expressions are accepted.
  382. # generated-members =
  383. # Tells whether missing members accessed in mixin class should be ignored. A
  384. # class is considered mixin if its name matches the mixin-class-rgx option.
  385. # Tells whether to warn about missing members when the owner of the attribute is
  386. # inferred to be None.
  387. ignore-none = true
  388. # This flag controls whether pylint should warn about no-member and similar
  389. # checks whenever an opaque object is returned when inferring. The inference can
  390. # return multiple potential results while evaluating a Python object, but some
  391. # branches might not be evaluated, which results in partial inference. In that
  392. # case, it might be useful to still emit no-member and other checks for the rest
  393. # of the inferred objects.
  394. ignore-on-opaque-inference = true
  395. # List of symbolic message names to ignore for Mixin members.
  396. ignored-checks-for-mixins = [
  397. "no-member",
  398. "not-async-context-manager",
  399. "not-context-manager",
  400. "attribute-defined-outside-init",
  401. ]
  402. # List of class names for which member attributes should not be checked (useful
  403. # for classes with dynamically set attributes). This supports the use of
  404. # qualified names.
  405. ignored-classes = [
  406. "optparse.Values",
  407. "thread._local",
  408. "_thread._local",
  409. "argparse.Namespace",
  410. ]
  411. # Show a hint with possible names when a member name was not found. The aspect of
  412. # finding the hint is based on edit distance.
  413. missing-member-hint = true
  414. # The minimum edit distance a name should have in order to be considered a
  415. # similar match for a missing member name.
  416. missing-member-hint-distance = 1
  417. # The total number of similar names that should be taken in consideration when
  418. # showing a hint for a missing member.
  419. missing-member-max-choices = 1
  420. # Regex pattern to define which classes are considered mixins.
  421. mixin-class-rgx = ".*[Mm]ixin"
  422. # List of decorators that change the signature of a decorated function.
  423. # signature-mutators =
  424. [tool.pylint.variables]
  425. # List of additional names supposed to be defined in builtins. Remember that you
  426. # should avoid defining new builtins when possible.
  427. # additional-builtins =
  428. # Tells whether unused global variables should be treated as a violation.
  429. allow-global-unused-variables = true
  430. # List of names allowed to shadow builtins
  431. # allowed-redefined-builtins =
  432. # List of strings which can identify a callback function by name. A callback name
  433. # must start or end with one of those strings.
  434. callbacks = ["cb_", "_cb"]
  435. # A regular expression matching the name of dummy variables (i.e. expected to not
  436. # be used).
  437. dummy-variables-rgx = "_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_"
  438. # Argument names that match this expression will be ignored.
  439. ignored-argument-names = "_.*|^ignored_|^unused_"
  440. # Tells whether we should check for unused import in __init__ files.
  441. # init-import =
  442. # List of qualified module names which can have objects that can redefine
  443. # builtins.
  444. redefining-builtins-modules = [
  445. "six.moves",
  446. "past.builtins",
  447. "future.builtins",
  448. "builtins",
  449. "io",
  450. ]