.pylintrc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  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-whitelist=
  6. # Add files or directories to the blacklist. They should be base names, not
  7. # paths.
  8. ignore=CVS,
  9. ext,
  10. # Add files or directories matching the regex patterns to the blacklist. The
  11. # regex matches against base names, not paths.
  12. ignore-patterns=salt.ext.*
  13. # Python code to execute, usually for sys.path manipulation such as
  14. # pygtk.require().
  15. #init-hook=
  16. # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
  17. # number of processors available to use.
  18. jobs=1
  19. # Control the amount of potential inferred values when inferring a single
  20. # object. This can help the performance when dealing with large functions or
  21. # complex, nested conditions.
  22. limit-inference-results=100
  23. # List of plugins (as comma separated values of python module names) to load,
  24. # usually to register additional checkers.
  25. load-plugins=saltpylint.pep8,
  26. saltpylint.pep263,
  27. saltpylint.strings,
  28. saltpylint.fileperms,
  29. saltpylint.py3modernize,
  30. saltpylint.smartup,
  31. saltpylint.minpyver,
  32. saltpylint.blacklist,
  33. saltpylint.thirdparty,
  34. saltpylint.dunder_del
  35. # Pickle collected data for later comparisons.
  36. persistent=no
  37. # Specify a configuration file.
  38. #rcfile=
  39. # When enabled, pylint would attempt to guess common misconfiguration and emit
  40. # user-friendly hints instead of false-positive error messages.
  41. suggestion-mode=yes
  42. # Allow loading of arbitrary C extensions. Extensions are imported into the
  43. # active Python interpreter and may run arbitrary code.
  44. unsafe-load-any-extension=no
  45. [MESSAGES CONTROL]
  46. # Only show warnings with the listed confidence levels. Leave empty to show
  47. # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
  48. confidence=
  49. # Disable the message, report, category or checker with the given id(s). You
  50. # can either give multiple identifiers separated by comma (,) or put this
  51. # option multiple times (only on the command line, not in the configuration
  52. # file where it should appear only once). You can also use "--disable=all" to
  53. # disable everything first and then reenable specific checks. For example, if
  54. # you want to run only the similarities checker, you can use "--disable=all
  55. # --enable=similarities". If you want to run only the classes checker, but have
  56. # no Warning level messages displayed, use "--disable=all --enable=classes
  57. # --disable=W".
  58. disable=R,
  59. locally-disabled,
  60. file-ignored,
  61. unexpected-special-method-signature,
  62. import-error,
  63. no-member,
  64. unsubscriptable-object,
  65. un-indexed-curly-braces-error,
  66. whitespace-before-colon,
  67. indentation-is-not-a-multiple-of-four-comment,
  68. blacklisted-name,
  69. invalid-name,
  70. missing-docstring,
  71. empty-docstring,
  72. misplaced-comparison-constant,
  73. unidiomatic-typecheck,
  74. wrong-import-order,
  75. ungrouped-imports,
  76. wrong-import-position,
  77. bad-mcs-method-argument,
  78. bad-mcs-classmethod-argument,
  79. line-too-long,
  80. too-many-lines,
  81. bad-continuation,
  82. exec-used,
  83. attribute-defined-outside-init,
  84. protected-access,
  85. reimported,
  86. fixme,
  87. global-statement,
  88. unused-variable,
  89. unused-argument,
  90. redefined-outer-name,
  91. redefined-builtin,
  92. undefined-loop-variable,
  93. logging-format-interpolation,
  94. invalid-format-index,
  95. line-too-long,
  96. unexpected-indentation-comment,
  97. continuation-line-indentation-is-not-a-multiple-of-four,
  98. continuation-line-missing-indentation-or-outdented,
  99. closing-bracket-does-not-match-indentation-of-opening-brackets-line,
  100. closing-bracket-does-not-match-visual-indentation,
  101. continuation-line-does-not-distinguish-itself-from-next-logical-line,
  102. continuation-line-over-indented-for-hanging-indent,
  103. continuation-line-over-indented-for-visual-indent,
  104. continuation-line-under-indented-for-visual-indent,
  105. visually-indented-line-with-same-indent-as-next-logical-line,
  106. unaligned-for-hanging-indent,
  107. block-comment-should-start-with-cardinal-space,
  108. too-many-leading-hastag-for-block-comment,
  109. module-level-import-not-at-top-of-file,
  110. do-not-assign-a-lambda-expression-use-a-def,
  111. 3rd-party-local-module-not-gated,
  112. pep8-reserved-keywords,
  113. str-format-in-logging,
  114. import-outside-toplevel,
  115. deprecated-method,
  116. repr-flag-used-in-string,
  117. keyword-arg-before-vararg,
  118. incompatible-py3-code
  119. # Enable the message, report, category or checker with the given id(s). You can
  120. # either give multiple identifier separated by comma (,) or put this option
  121. # multiple time (only on the command line, not in the configuration file where
  122. # it should appear only once). See also the "--disable" option for examples.
  123. enable=c-extension-no-member,
  124. literal-comparison
  125. [REPORTS]
  126. # Python expression which should return a score less than or equal to 10. You
  127. # have access to the variables 'error', 'warning', 'refactor', and 'convention'
  128. # which contain the number of messages in each category, as well as 'statement'
  129. # which is the total number of statements analyzed. This score is used by the
  130. # global evaluation report (RP0004).
  131. evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
  132. # Template used to display messages. This is a python new-style format string
  133. # used to format the message information. See doc for all details.
  134. msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
  135. # Set the output format. Available formats are text, parseable, colorized, json
  136. # and msvs (visual studio). You can also give a reporter class, e.g.
  137. # mypackage.mymodule.MyReporterClass.
  138. output-format=parseable
  139. # Tells whether to display a full report or only the messages.
  140. reports=no
  141. # Activate the evaluation score.
  142. score=yes
  143. [REFACTORING]
  144. # Maximum number of nested blocks for function / method body
  145. max-nested-blocks=5
  146. # Complete name of functions that never returns. When checking for
  147. # inconsistent-return-statements if a never returning function is called then
  148. # it will be considered as an explicit return statement and no message will be
  149. # printed.
  150. never-returning-functions=sys.exit
  151. [FORMAT]
  152. # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
  153. expected-line-ending-format=LF
  154. # Regexp for a line that is allowed to be longer than the limit.
  155. ignore-long-lines=^\s*(# )?<?https?://\S+>?$
  156. # Number of spaces of indent required inside a hanging or continued line.
  157. indent-after-paren=4
  158. # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
  159. # tab).
  160. indent-string=' '
  161. # Maximum number of characters on a single line.
  162. max-line-length=120
  163. # Maximum number of lines in a module.
  164. max-module-lines=3000
  165. # List of optional constructs for which whitespace checking is disabled. `dict-
  166. # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
  167. # `trailing-comma` allows a space between comma and closing bracket: (a, ).
  168. # `empty-line` allows space-only lines.
  169. no-space-check=trailing-comma,
  170. dict-separator
  171. # Allow the body of a class to be on the same line as the declaration if body
  172. # contains single statement.
  173. single-line-class-stmt=no
  174. # Allow the body of an if to be on the same line as the test if there is no
  175. # else.
  176. single-line-if-stmt=no
  177. [MISCELLANEOUS]
  178. # List of note tags to take in consideration, separated by a comma.
  179. notes=FIXME,
  180. FIX,
  181. XXX,
  182. TODO
  183. [BASIC]
  184. # Naming style matching correct argument names.
  185. argument-naming-style=snake_case
  186. # Regular expression matching correct argument names. Overrides argument-
  187. # naming-style.
  188. argument-rgx=[a-z_][a-z0-9_]{2,30}$
  189. # Naming style matching correct attribute names.
  190. attr-naming-style=snake_case
  191. # Regular expression matching correct attribute names. Overrides attr-naming-
  192. # style.
  193. attr-rgx=[a-z_][a-z0-9_]{2,30}$
  194. # Bad variable names which should always be refused, separated by a comma.
  195. bad-names=foo,
  196. bar,
  197. baz,
  198. toto,
  199. tutu,
  200. tata
  201. # Naming style matching correct class attribute names.
  202. class-attribute-naming-style=any
  203. # Regular expression matching correct class attribute names. Overrides class-
  204. # attribute-naming-style.
  205. class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
  206. # Naming style matching correct class names.
  207. class-naming-style=PascalCase
  208. # Regular expression matching correct class names. Overrides class-naming-
  209. # style.
  210. class-rgx=[A-Z_][a-zA-Z0-9]+$
  211. # Naming style matching correct constant names.
  212. const-naming-style=UPPER_CASE
  213. # Regular expression matching correct constant names. Overrides const-naming-
  214. # style.
  215. const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
  216. # Minimum line length for functions/classes that require docstrings, shorter
  217. # ones are exempt.
  218. docstring-min-length=-1
  219. # Naming style matching correct function names.
  220. function-naming-style=snake_case
  221. # Regular expression matching correct function names. Overrides function-
  222. # naming-style.
  223. function-rgx=[a-z_][a-z0-9_]{2,30}$
  224. # Good variable names which should always be accepted, separated by a comma.
  225. good-names=i,
  226. j,
  227. k,
  228. ex,
  229. Run,
  230. _,
  231. log
  232. # Include a hint for the correct naming format with invalid-name.
  233. include-naming-hint=yes
  234. # Naming style matching correct inline iteration names.
  235. inlinevar-naming-style=any
  236. # Regular expression matching correct inline iteration names. Overrides
  237. # inlinevar-naming-style.
  238. inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
  239. # Naming style matching correct method names.
  240. method-naming-style=snake_case
  241. # Regular expression matching correct method names. Overrides method-naming-
  242. # style.
  243. method-rgx=[a-z_][a-z0-9_]{2,30}$
  244. # Naming style matching correct module names.
  245. module-naming-style=snake_case
  246. # Regular expression matching correct module names. Overrides module-naming-
  247. # style.
  248. module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  249. # Colon-delimited sets of names that determine each other's naming style when
  250. # the name regexes allow several styles.
  251. name-group=
  252. # Regular expression which should only match function or class names that do
  253. # not require a docstring.
  254. no-docstring-rgx=__.*__
  255. # List of decorators that produce properties, such as abc.abstractproperty. Add
  256. # to this list to register other decorators that produce valid properties.
  257. # These decorators are taken in consideration only for invalid-name.
  258. property-classes=abc.abstractproperty
  259. # Naming style matching correct variable names.
  260. variable-naming-style=snake_case
  261. # Regular expression matching correct variable names. Overrides variable-
  262. # naming-style.
  263. variable-rgx=[a-z_][a-z0-9_]{2,30}$
  264. [STRING]
  265. # This flag controls whether the implicit-str-concat-in-sequence should
  266. # generate a warning on implicit string concatenation in sequences defined over
  267. # several lines.
  268. check-str-concat-over-line-jumps=no
  269. # Enforce string formatting over string substitution
  270. enforce-string-formatting-over-substitution=yes
  271. # Force string substitution usage on strings to always be an error.
  272. string-substitutions-usage-is-an-error=yes
  273. # Force un-indexed curly braces on a 'string.format()' call to always be an
  274. # error.
  275. un-indexed-curly-braces-always-error=no
  276. [VARIABLES]
  277. # List of additional names supposed to be defined in builtins. Remember that
  278. # you should avoid defining new builtins when possible.
  279. additional-builtins=__opts__,
  280. __utils__,
  281. __salt__,
  282. __pillar__,
  283. __grains__,
  284. __context__,
  285. __runner__,
  286. __ret__,
  287. __env__,
  288. __low__,
  289. __states__,
  290. __lowstate__,
  291. __running__,
  292. __active_provider_name__,
  293. __master_opts__,
  294. __jid_event__,
  295. __instance_id__,
  296. __salt_system_encoding__,
  297. __proxy__,
  298. __serializers__,
  299. __reg__,
  300. __executors__,
  301. __events__
  302. # Tells whether unused global variables should be treated as a violation.
  303. allow-global-unused-variables=yes
  304. # List of strings which can identify a callback function by name. A callback
  305. # name must start or end with one of those strings.
  306. callbacks=cb_,
  307. _cb
  308. # A regular expression matching the name of dummy variables (i.e. expected to
  309. # not be used).
  310. dummy-variables-rgx=_|dummy
  311. # Argument names that match this expression will be ignored. Default to name
  312. # with leading underscore.
  313. ignored-argument-names=_.*
  314. # Tells whether we should check for unused import in __init__ files.
  315. init-import=no
  316. # List of qualified module names which can have objects that can redefine
  317. # builtins.
  318. redefining-builtins-modules=six.moves,
  319. salt.ext.six.moves,
  320. past.builtins,
  321. future.builtins,
  322. builtins,
  323. io
  324. [LOGGING]
  325. # Format style used to check logging format string. `old` means using %
  326. # formatting, `new` is for `{}` formatting,and `fstr` is for f-strings.
  327. logging-format-style=old
  328. # Logging modules to check that the string format arguments are in logging
  329. # function parameter format.
  330. logging-modules=
  331. [SPELLING]
  332. # Limits count of emitted suggestions for spelling mistakes.
  333. max-spelling-suggestions=4
  334. # Spelling dictionary name. Available dictionaries: none. To make it work,
  335. # install the python-enchant package.
  336. spelling-dict=
  337. # List of comma separated words that should not be checked.
  338. spelling-ignore-words=
  339. # A path to a file that contains the private dictionary; one word per line.
  340. spelling-private-dict-file=
  341. # Tells whether to store unknown words to the private dictionary (see the
  342. # --spelling-private-dict-file option) instead of raising a message.
  343. spelling-store-unknown-words=no
  344. [TYPECHECK]
  345. # List of decorators that produce context managers, such as
  346. # contextlib.contextmanager. Add to this list to register other decorators that
  347. # produce valid context managers.
  348. contextmanager-decorators=contextlib.contextmanager
  349. # List of members which are set dynamically and missed by pylint inference
  350. # system, and so shouldn't trigger E1101 when accessed. Python regular
  351. # expressions are accepted.
  352. generated-members=REQUEST,
  353. acl_users,
  354. aq_parent
  355. # Tells whether missing members accessed in mixin class should be ignored. A
  356. # mixin class is detected if its name ends with "mixin" (case insensitive).
  357. ignore-mixin-members=yes
  358. # Tells whether to warn about missing members when the owner of the attribute
  359. # is inferred to be None.
  360. ignore-none=yes
  361. # This flag controls whether pylint should warn about no-member and similar
  362. # checks whenever an opaque object is returned when inferring. The inference
  363. # can return multiple potential results while evaluating a Python object, but
  364. # some branches might not be evaluated, which results in partial inference. In
  365. # that case, it might be useful to still emit no-member and other checks for
  366. # the rest of the inferred objects.
  367. ignore-on-opaque-inference=yes
  368. # List of class names for which member attributes should not be checked (useful
  369. # for classes with dynamically set attributes). This supports the use of
  370. # qualified names.
  371. ignored-classes=SQLObject
  372. # List of module names for which member attributes should not be checked
  373. # (useful for modules/projects where namespaces are manipulated during runtime
  374. # and thus existing member attributes cannot be deduced by static analysis). It
  375. # supports qualified module names, as well as Unix pattern matching.
  376. ignored-modules=salt.ext.six.moves,
  377. six.moves,
  378. _MovedItems,
  379. # Show a hint with possible names when a member name was not found. The aspect
  380. # of finding the hint is based on edit distance.
  381. missing-member-hint=yes
  382. # The minimum edit distance a name should have in order to be considered a
  383. # similar match for a missing member name.
  384. missing-member-hint-distance=1
  385. # The total number of similar names that should be taken in consideration when
  386. # showing a hint for a missing member.
  387. missing-member-max-choices=1
  388. # List of decorators that change the signature of a decorated function.
  389. signature-mutators=
  390. [SIMILARITIES]
  391. # Ignore comments when computing similarities.
  392. ignore-comments=yes
  393. # Ignore docstrings when computing similarities.
  394. ignore-docstrings=yes
  395. # Ignore imports when computing similarities.
  396. ignore-imports=no
  397. # Minimum lines number of a similarity.
  398. min-similarity-lines=4
  399. [FILEPERMS]
  400. # Desired file permissons. Default: 0644
  401. fileperms-default=0644
  402. # File paths to ignore file permission. Glob patterns allowed.
  403. fileperms-ignore-paths=setup.py,noxfile.py,tests/runtests.py,tests/jenkins*.py,tests/saltsh.py,tests/buildpackage.py,tests/unit/files/rosters/ansible/roster.py
  404. [MODERNIZE]
  405. # Fix up doctests only
  406. modernize-doctests-only=no
  407. # Each FIX specifies a transformation; "default" includes default fixes.
  408. modernize-fix=
  409. # Use 'from __future__ import unicode_literals' (only useful for Python 2.6+).
  410. modernize-future-unicode=no
  411. # Exclude fixes that depend on the six package.
  412. modernize-no-six=no
  413. # Comma separated list of fixer names not to fix.
  414. modernize-nofix=
  415. # Modify the grammar so that print() is a function.
  416. modernize-print-function=yes
  417. # Wrap unicode literals in six.u().
  418. modernize-six-unicode=no
  419. [MININUM-PYTHON-VERSION]
  420. # The desired minimum python version to enforce. Default: 2.6
  421. minimum-python-version=2.7
  422. [CLASSES]
  423. # List of method names used to declare (i.e. assign) instance attributes.
  424. defining-attr-methods=__init__,
  425. __new__,
  426. setUp
  427. # List of member names, which should be excluded from the protected access
  428. # warning.
  429. exclude-protected=_asdict,
  430. _fields,
  431. _replace,
  432. _source,
  433. _make
  434. # List of valid names for the first argument in a class method.
  435. valid-classmethod-first-arg=cls
  436. # List of valid names for the first argument in a metaclass class method.
  437. valid-metaclass-classmethod-first-arg=mcs
  438. [DESIGN]
  439. # Maximum number of arguments for function / method.
  440. max-args=35
  441. # Maximum number of attributes for a class (see R0902).
  442. max-attributes=7
  443. # Maximum number of boolean expressions in an if statement (see R0916).
  444. max-bool-expr=5
  445. # Maximum number of branch for function / method body.
  446. max-branches=48
  447. # Maximum number of locals for function / method body.
  448. max-locals=40
  449. # Maximum number of parents for a class (see R0901).
  450. max-parents=7
  451. # Maximum number of public methods for a class (see R0904).
  452. max-public-methods=20
  453. # Maximum number of return / yield for function / method body.
  454. max-returns=6
  455. # Maximum number of statements in function / method body.
  456. max-statements=100
  457. # Minimum number of public methods for a class (see R0903).
  458. min-public-methods=2
  459. [IMPORTS]
  460. # List of modules that can be imported at any level, not just the top level
  461. # one.
  462. allow-any-import-level=
  463. # Allow wildcard imports from modules that define __all__.
  464. allow-wildcard-with-all=yes
  465. # Analyse import fallback blocks. This can be used to support both Python 2 and
  466. # 3 compatible code, which means that the block might have code that exists
  467. # only in one or another interpreter, leading to false positives when analysed.
  468. analyse-fallback-blocks=yes
  469. # Deprecated modules which should not be used, separated by a comma.
  470. deprecated-modules=regsub,
  471. TERMIOS,
  472. Bastion,
  473. rexec
  474. # Create a graph of external dependencies in the given file (report RP0402 must
  475. # not be disabled).
  476. ext-import-graph=
  477. # Create a graph of every (i.e. internal and external) dependencies in the
  478. # given file (report RP0402 must not be disabled).
  479. import-graph=
  480. # Create a graph of internal dependencies in the given file (report RP0402 must
  481. # not be disabled).
  482. int-import-graph=
  483. # Force import order to recognize a module as part of the standard
  484. # compatibility libraries.
  485. known-standard-library=
  486. # Force import order to recognize a module as part of a third party library.
  487. known-third-party=enchant
  488. # Couples of modules and preferred modules, separated by a comma.
  489. preferred-modules=
  490. [BLACKLISTED-FUNCTIONS]
  491. # List of blacklisted functions and suggested replacements
  492. #
  493. # NOTE: This pylint check will infer the full name of the function by walking
  494. # back up from the function name to the parent, to the parent's parent, etc.,
  495. # and this means that functions which come from platform-specific modules need
  496. # to be referenced using name of the module from which the function was
  497. # imported. This happens a lot in the os and os.path modules. Functions from
  498. # os.path should be defined using posixpath.funcname and ntpath.funcname, while
  499. # functions from os should be defined using posix.funcname and nt.funcname.
  500. #
  501. # When defining a blacklisted function, the format is:
  502. #
  503. # <func_name>=<suggested_replacement>
  504. #
  505. # The replacement text will be included in the alert message.
  506. #
  507. blacklisted-functions=posix.umask=salt.utils.files.set_umask or get_umask,
  508. nt.umask=salt.utils.files.set_umask or get_umask
  509. [3RD-PARTY-IMPORTS]
  510. # Known 3rd-party modules which don' require being gated, separated by a comma
  511. allowed-3rd-party-modules=msgpack,
  512. tornado,
  513. yaml,
  514. jinja2,
  515. Crypto,
  516. requests,
  517. libcloud,
  518. zmq,
  519. pytest,
  520. setuptools,
  521. pytestsalt,
  522. saltfactories,
  523. distro
  524. [EXCEPTIONS]
  525. # Exceptions that will emit a warning when being caught. Defaults to
  526. # "BaseException, Exception".
  527. overgeneral-exceptions=BaseException,
  528. Exception