1
0

.pylintrc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  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.smartup,
  30. saltpylint.py3modernize,
  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. [REPORTS]
  125. # Python expression which should return a score less than or equal to 10. You
  126. # have access to the variables 'error', 'warning', 'refactor', and 'convention'
  127. # which contain the number of messages in each category, as well as 'statement'
  128. # which is the total number of statements analyzed. This score is used by the
  129. # global evaluation report (RP0004).
  130. evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
  131. # Template used to display messages. This is a python new-style format string
  132. # used to format the message information. See doc for all details.
  133. msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
  134. # Set the output format. Available formats are text, parseable, colorized, json
  135. # and msvs (visual studio). You can also give a reporter class, e.g.
  136. # mypackage.mymodule.MyReporterClass.
  137. output-format=parseable
  138. # Tells whether to display a full report or only the messages.
  139. reports=no
  140. # Activate the evaluation score.
  141. score=yes
  142. [REFACTORING]
  143. # Maximum number of nested blocks for function / method body
  144. max-nested-blocks=5
  145. # Complete name of functions that never returns. When checking for
  146. # inconsistent-return-statements if a never returning function is called then
  147. # it will be considered as an explicit return statement and no message will be
  148. # printed.
  149. never-returning-functions=sys.exit
  150. [FORMAT]
  151. # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
  152. expected-line-ending-format=LF
  153. # Regexp for a line that is allowed to be longer than the limit.
  154. ignore-long-lines=^\s*(# )?<?https?://\S+>?$
  155. # Number of spaces of indent required inside a hanging or continued line.
  156. indent-after-paren=4
  157. # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
  158. # tab).
  159. indent-string=' '
  160. # Maximum number of characters on a single line.
  161. max-line-length=120
  162. # Maximum number of lines in a module.
  163. max-module-lines=3000
  164. # List of optional constructs for which whitespace checking is disabled. `dict-
  165. # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
  166. # `trailing-comma` allows a space between comma and closing bracket: (a, ).
  167. # `empty-line` allows space-only lines.
  168. no-space-check=trailing-comma,
  169. dict-separator
  170. # Allow the body of a class to be on the same line as the declaration if body
  171. # contains single statement.
  172. single-line-class-stmt=no
  173. # Allow the body of an if to be on the same line as the test if there is no
  174. # else.
  175. single-line-if-stmt=no
  176. [MISCELLANEOUS]
  177. # List of note tags to take in consideration, separated by a comma.
  178. notes=FIXME,
  179. FIX,
  180. XXX,
  181. TODO
  182. [BASIC]
  183. # Naming style matching correct argument names.
  184. argument-naming-style=snake_case
  185. # Regular expression matching correct argument names. Overrides argument-
  186. # naming-style.
  187. argument-rgx=[a-z_][a-z0-9_]{2,30}$
  188. # Naming style matching correct attribute names.
  189. attr-naming-style=snake_case
  190. # Regular expression matching correct attribute names. Overrides attr-naming-
  191. # style.
  192. attr-rgx=[a-z_][a-z0-9_]{2,30}$
  193. # Bad variable names which should always be refused, separated by a comma.
  194. bad-names=foo,
  195. bar,
  196. baz,
  197. toto,
  198. tutu,
  199. tata
  200. # Naming style matching correct class attribute names.
  201. class-attribute-naming-style=any
  202. # Regular expression matching correct class attribute names. Overrides class-
  203. # attribute-naming-style.
  204. class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
  205. # Naming style matching correct class names.
  206. class-naming-style=PascalCase
  207. # Regular expression matching correct class names. Overrides class-naming-
  208. # style.
  209. class-rgx=[A-Z_][a-zA-Z0-9]+$
  210. # Naming style matching correct constant names.
  211. const-naming-style=UPPER_CASE
  212. # Regular expression matching correct constant names. Overrides const-naming-
  213. # style.
  214. const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
  215. # Minimum line length for functions/classes that require docstrings, shorter
  216. # ones are exempt.
  217. docstring-min-length=-1
  218. # Naming style matching correct function names.
  219. function-naming-style=snake_case
  220. # Regular expression matching correct function names. Overrides function-
  221. # naming-style.
  222. function-rgx=[a-z_][a-z0-9_]{2,30}$
  223. # Good variable names which should always be accepted, separated by a comma.
  224. good-names=i,
  225. j,
  226. k,
  227. ex,
  228. Run,
  229. _,
  230. log
  231. # Include a hint for the correct naming format with invalid-name.
  232. include-naming-hint=yes
  233. # Naming style matching correct inline iteration names.
  234. inlinevar-naming-style=any
  235. # Regular expression matching correct inline iteration names. Overrides
  236. # inlinevar-naming-style.
  237. inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
  238. # Naming style matching correct method names.
  239. method-naming-style=snake_case
  240. # Regular expression matching correct method names. Overrides method-naming-
  241. # style.
  242. method-rgx=[a-z_][a-z0-9_]{2,30}$
  243. # Naming style matching correct module names.
  244. module-naming-style=snake_case
  245. # Regular expression matching correct module names. Overrides module-naming-
  246. # style.
  247. module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  248. # Colon-delimited sets of names that determine each other's naming style when
  249. # the name regexes allow several styles.
  250. name-group=
  251. # Regular expression which should only match function or class names that do
  252. # not require a docstring.
  253. no-docstring-rgx=__.*__
  254. # List of decorators that produce properties, such as abc.abstractproperty. Add
  255. # to this list to register other decorators that produce valid properties.
  256. # These decorators are taken in consideration only for invalid-name.
  257. property-classes=abc.abstractproperty
  258. # Naming style matching correct variable names.
  259. variable-naming-style=snake_case
  260. # Regular expression matching correct variable names. Overrides variable-
  261. # naming-style.
  262. variable-rgx=[a-z_][a-z0-9_]{2,30}$
  263. [STRING]
  264. # This flag controls whether the implicit-str-concat-in-sequence should
  265. # generate a warning on implicit string concatenation in sequences defined over
  266. # several lines.
  267. check-str-concat-over-line-jumps=no
  268. # Enforce string formatting over string substitution
  269. enforce-string-formatting-over-substitution=yes
  270. # Force string substitution usage on strings to always be an error.
  271. string-substitutions-usage-is-an-error=yes
  272. # Force un-indexed curly braces on a 'string.format()' call to always be an
  273. # error.
  274. un-indexed-curly-braces-always-error=no
  275. [VARIABLES]
  276. # List of additional names supposed to be defined in builtins. Remember that
  277. # you should avoid defining new builtins when possible.
  278. additional-builtins=__opts__,
  279. __utils__,
  280. __salt__,
  281. __pillar__,
  282. __grains__,
  283. __context__,
  284. __runner__,
  285. __ret__,
  286. __env__,
  287. __low__,
  288. __states__,
  289. __lowstate__,
  290. __running__,
  291. __active_provider_name__,
  292. __master_opts__,
  293. __jid_event__,
  294. __instance_id__,
  295. __salt_system_encoding__,
  296. __proxy__,
  297. __serializers__,
  298. __reg__,
  299. __executors__,
  300. __events__
  301. # Tells whether unused global variables should be treated as a violation.
  302. allow-global-unused-variables=yes
  303. # List of strings which can identify a callback function by name. A callback
  304. # name must start or end with one of those strings.
  305. callbacks=cb_,
  306. _cb
  307. # A regular expression matching the name of dummy variables (i.e. expected to
  308. # not be used).
  309. dummy-variables-rgx=_|dummy
  310. # Argument names that match this expression will be ignored. Default to name
  311. # with leading underscore.
  312. ignored-argument-names=_.*
  313. # Tells whether we should check for unused import in __init__ files.
  314. init-import=no
  315. # List of qualified module names which can have objects that can redefine
  316. # builtins.
  317. redefining-builtins-modules=six.moves,
  318. salt.ext.six.moves,
  319. past.builtins,
  320. future.builtins,
  321. builtins,
  322. io
  323. [LOGGING]
  324. # Format style used to check logging format string. `old` means using %
  325. # formatting, `new` is for `{}` formatting,and `fstr` is for f-strings.
  326. logging-format-style=old
  327. # Logging modules to check that the string format arguments are in logging
  328. # function parameter format.
  329. logging-modules=
  330. [SPELLING]
  331. # Limits count of emitted suggestions for spelling mistakes.
  332. max-spelling-suggestions=4
  333. # Spelling dictionary name. Available dictionaries: none. To make it work,
  334. # install the python-enchant package.
  335. spelling-dict=
  336. # List of comma separated words that should not be checked.
  337. spelling-ignore-words=
  338. # A path to a file that contains the private dictionary; one word per line.
  339. spelling-private-dict-file=
  340. # Tells whether to store unknown words to the private dictionary (see the
  341. # --spelling-private-dict-file option) instead of raising a message.
  342. spelling-store-unknown-words=no
  343. [TYPECHECK]
  344. # List of decorators that produce context managers, such as
  345. # contextlib.contextmanager. Add to this list to register other decorators that
  346. # produce valid context managers.
  347. contextmanager-decorators=contextlib.contextmanager
  348. # List of members which are set dynamically and missed by pylint inference
  349. # system, and so shouldn't trigger E1101 when accessed. Python regular
  350. # expressions are accepted.
  351. generated-members=REQUEST,
  352. acl_users,
  353. aq_parent
  354. # Tells whether missing members accessed in mixin class should be ignored. A
  355. # mixin class is detected if its name ends with "mixin" (case insensitive).
  356. ignore-mixin-members=yes
  357. # Tells whether to warn about missing members when the owner of the attribute
  358. # is inferred to be None.
  359. ignore-none=yes
  360. # This flag controls whether pylint should warn about no-member and similar
  361. # checks whenever an opaque object is returned when inferring. The inference
  362. # can return multiple potential results while evaluating a Python object, but
  363. # some branches might not be evaluated, which results in partial inference. In
  364. # that case, it might be useful to still emit no-member and other checks for
  365. # the rest of the inferred objects.
  366. ignore-on-opaque-inference=yes
  367. # List of class names for which member attributes should not be checked (useful
  368. # for classes with dynamically set attributes). This supports the use of
  369. # qualified names.
  370. ignored-classes=SQLObject
  371. # List of module names for which member attributes should not be checked
  372. # (useful for modules/projects where namespaces are manipulated during runtime
  373. # and thus existing member attributes cannot be deduced by static analysis). It
  374. # supports qualified module names, as well as Unix pattern matching.
  375. ignored-modules=salt.ext.six.moves,
  376. six.moves,
  377. _MovedItems,
  378. # Show a hint with possible names when a member name was not found. The aspect
  379. # of finding the hint is based on edit distance.
  380. missing-member-hint=yes
  381. # The minimum edit distance a name should have in order to be considered a
  382. # similar match for a missing member name.
  383. missing-member-hint-distance=1
  384. # The total number of similar names that should be taken in consideration when
  385. # showing a hint for a missing member.
  386. missing-member-max-choices=1
  387. # List of decorators that change the signature of a decorated function.
  388. signature-mutators=
  389. [SIMILARITIES]
  390. # Ignore comments when computing similarities.
  391. ignore-comments=yes
  392. # Ignore docstrings when computing similarities.
  393. ignore-docstrings=yes
  394. # Ignore imports when computing similarities.
  395. ignore-imports=no
  396. # Minimum lines number of a similarity.
  397. min-similarity-lines=4
  398. [FILEPERMS]
  399. # Desired file permissons. Default: 0644
  400. fileperms-default=0644
  401. # File paths to ignore file permission. Glob patterns allowed.
  402. 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
  403. [MODERNIZE]
  404. # Fix up doctests only
  405. modernize-doctests-only=no
  406. # Each FIX specifies a transformation; "default" includes default fixes.
  407. modernize-fix=
  408. # Use 'from __future__ import unicode_literals' (only useful for Python 2.6+).
  409. modernize-future-unicode=no
  410. # Exclude fixes that depend on the six package.
  411. modernize-no-six=no
  412. # Comma separated list of fixer names not to fix.
  413. modernize-nofix=
  414. # Modify the grammar so that print() is a function.
  415. modernize-print-function=yes
  416. # Wrap unicode literals in six.u().
  417. modernize-six-unicode=no
  418. [MININUM-PYTHON-VERSION]
  419. # The desired minimum python version to enforce. Default: 2.6
  420. minimum-python-version=2.7
  421. [CLASSES]
  422. # List of method names used to declare (i.e. assign) instance attributes.
  423. defining-attr-methods=__init__,
  424. __new__,
  425. setUp
  426. # List of member names, which should be excluded from the protected access
  427. # warning.
  428. exclude-protected=_asdict,
  429. _fields,
  430. _replace,
  431. _source,
  432. _make
  433. # List of valid names for the first argument in a class method.
  434. valid-classmethod-first-arg=cls
  435. # List of valid names for the first argument in a metaclass class method.
  436. valid-metaclass-classmethod-first-arg=mcs
  437. [DESIGN]
  438. # Maximum number of arguments for function / method.
  439. max-args=35
  440. # Maximum number of attributes for a class (see R0902).
  441. max-attributes=7
  442. # Maximum number of boolean expressions in an if statement (see R0916).
  443. max-bool-expr=5
  444. # Maximum number of branch for function / method body.
  445. max-branches=48
  446. # Maximum number of locals for function / method body.
  447. max-locals=40
  448. # Maximum number of parents for a class (see R0901).
  449. max-parents=7
  450. # Maximum number of public methods for a class (see R0904).
  451. max-public-methods=20
  452. # Maximum number of return / yield for function / method body.
  453. max-returns=6
  454. # Maximum number of statements in function / method body.
  455. max-statements=100
  456. # Minimum number of public methods for a class (see R0903).
  457. min-public-methods=2
  458. [IMPORTS]
  459. # List of modules that can be imported at any level, not just the top level
  460. # one.
  461. allow-any-import-level=
  462. # Allow wildcard imports from modules that define __all__.
  463. allow-wildcard-with-all=yes
  464. # Analyse import fallback blocks. This can be used to support both Python 2 and
  465. # 3 compatible code, which means that the block might have code that exists
  466. # only in one or another interpreter, leading to false positives when analysed.
  467. analyse-fallback-blocks=yes
  468. # Deprecated modules which should not be used, separated by a comma.
  469. deprecated-modules=regsub,
  470. TERMIOS,
  471. Bastion,
  472. rexec
  473. # Create a graph of external dependencies in the given file (report RP0402 must
  474. # not be disabled).
  475. ext-import-graph=
  476. # Create a graph of every (i.e. internal and external) dependencies in the
  477. # given file (report RP0402 must not be disabled).
  478. import-graph=
  479. # Create a graph of internal dependencies in the given file (report RP0402 must
  480. # not be disabled).
  481. int-import-graph=
  482. # Force import order to recognize a module as part of the standard
  483. # compatibility libraries.
  484. known-standard-library=
  485. # Force import order to recognize a module as part of a third party library.
  486. known-third-party=enchant
  487. # Couples of modules and preferred modules, separated by a comma.
  488. preferred-modules=
  489. [BLACKLISTED-FUNCTIONS]
  490. # List of blacklisted functions and suggested replacements
  491. #
  492. # NOTE: This pylint check will infer the full name of the function by walking
  493. # back up from the function name to the parent, to the parent's parent, etc.,
  494. # and this means that functions which come from platform-specific modules need
  495. # to be referenced using name of the module from which the function was
  496. # imported. This happens a lot in the os and os.path modules. Functions from
  497. # os.path should be defined using posixpath.funcname and ntpath.funcname, while
  498. # functions from os should be defined using posix.funcname and nt.funcname.
  499. #
  500. # When defining a blacklisted function, the format is:
  501. #
  502. # <func_name>=<suggested_replacement>
  503. #
  504. # The replacement text will be included in the alert message.
  505. #
  506. blacklisted-functions=posix.umask=salt.utils.files.set_umask or get_umask,
  507. nt.umask=salt.utils.files.set_umask or get_umask
  508. [3RD-PARTY-IMPORTS]
  509. # Known 3rd-party modules which don' require being gated, separated by a comma
  510. allowed-3rd-party-modules=msgpack,
  511. tornado,
  512. yaml,
  513. jinja2,
  514. Crypto,
  515. requests,
  516. libcloud,
  517. zmq,
  518. pytest,
  519. setuptools,
  520. saltfactories
  521. [EXCEPTIONS]
  522. # Exceptions that will emit a warning when being caught. Defaults to
  523. # "BaseException, Exception".
  524. overgeneral-exceptions=BaseException,
  525. Exception