1
0

.pylintrc 21 KB

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