1
0

.testing.pylintrc 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. [MASTER]
  2. # Specify a configuration file.
  3. #rcfile=
  4. # Python code to execute, usually for sys.path manipulation such as
  5. # pygtk.require().
  6. #init-hook=
  7. # Add files or directories to the blacklist. They should be base names, not
  8. # paths.
  9. ignore=CVS,ext
  10. # Pickle collected data for later comparisons.
  11. persistent=no
  12. # List of plugins (as comma separated values of python modules names) to load,
  13. # usually to register additional checkers.
  14. load-plugins=saltpylint.pep8,
  15. saltpylint.pep263,
  16. saltpylint.strings,
  17. saltpylint.fileperms,
  18. saltpylint.py3modernize,
  19. saltpylint.smartup,
  20. saltpylint.minpyver,
  21. saltpylint.blacklist,
  22. saltpylint.thirdparty,
  23. saltpylint.dunder_del
  24. # Use multiple processes to speed up Pylint.
  25. # Don't bump this values on PyLint 1.4.0 - Know bug that ignores the passed --rcfile
  26. jobs=1
  27. # List of blacklisted functions and suggested replacements
  28. #
  29. # NOTE: This pylint check will infer the full name of the function by walking
  30. # back up from the function name to the parent, to the parent's parent, etc.,
  31. # and this means that functions which come from platform-specific modules need
  32. # to be referenced using name of the module from which the function was
  33. # imported. This happens a lot in the os and os.path modules. Functions from
  34. # os.path should be defined using posixpath.funcname and ntpath.funcname, while
  35. # functions from os should be defined using posix.funcname and nt.funcname.
  36. #
  37. # When defining a blacklisted function, the format is:
  38. #
  39. # <func_name>=<suggested_replacement>
  40. #
  41. # The replacement text will be included in the alert message.
  42. #
  43. blacklisted-functions=posix.umask=salt.utils.files.set_umask or get_umask,
  44. nt.umask=salt.utils.files.set_umask or get_umask
  45. # Allow loading of arbitrary C extensions. Extensions are imported into the
  46. # active Python interpreter and may run arbitrary code.
  47. unsafe-load-any-extension=no
  48. # A comma-separated list of package or module names from where C extensions may
  49. # be loaded. Extensions are loading into the active Python interpreter and may
  50. # run arbitrary code
  51. extension-pkg-whitelist=
  52. # Fileperms Lint Plugin Settings
  53. fileperms-default=0644
  54. fileperms-ignore-paths=setup.py,tests/runtests.py,tests/jenkins*.py,tests/saltsh.py,tests/buildpackage.py
  55. # Minimum Python Version To Enforce
  56. minimum-python-version = 2.7
  57. # Allowed 3rd-party package imports
  58. allowed-3rd-party-modules = msgpack,
  59. tornado,
  60. yaml,
  61. jinja2,
  62. Crypto,
  63. requests,
  64. libcloud,
  65. zmq,
  66. pytest,
  67. pytestsalt
  68. [MESSAGES CONTROL]
  69. # Only show warnings with the listed confidence levels. Leave empty to show
  70. # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
  71. confidence=
  72. # Enable the message, report, category or checker with the given id(s). You can
  73. # either give multiple identifier separated by comma (,) or put this option
  74. # multiple time. See also the "--disable" option for examples.
  75. #enable=
  76. # Disable the message, report, category or checker with the given id(s). You
  77. # can either give multiple identifiers separated by comma (,) or put this
  78. # option multiple times (only on the command line, not in the configuration
  79. # file where it should appear only once).You can also use "--disable=all" to
  80. # disable everything first and then re-enable specific checks. For example, if
  81. # you want to run only the similarities checker, you can use "--disable=all
  82. # --enable=similarities". If you want to run only the classes checker, but have
  83. # no Warning level messages displayed, use"--disable=all --enable=classes
  84. # --disable=W"
  85. disable=R,
  86. I0011,
  87. I0012,
  88. I0013,
  89. E0302,
  90. E0401,
  91. E1101,
  92. E1103,
  93. E1136,
  94. E1320,
  95. E8114,
  96. C0102,
  97. C0103,
  98. C0111,
  99. C0112,
  100. C0122,
  101. C0123,
  102. C0411,
  103. C0412,
  104. C0413,
  105. C0203,
  106. C0204,
  107. C0301,
  108. C0302,
  109. C0330,
  110. W0110,
  111. W0122,
  112. W0142,
  113. W0201,
  114. W0212,
  115. W0404,
  116. W0511,
  117. W0603,
  118. W0612,
  119. W0613,
  120. W0621,
  121. W0622,
  122. W0631,
  123. W0704,
  124. W1202,
  125. W1307,
  126. F0220,
  127. F0401,
  128. E8501,
  129. E8116,
  130. E8121,
  131. E8122,
  132. E8123,
  133. E8124,
  134. E8125,
  135. E8126,
  136. E8127,
  137. E8128,
  138. E8129,
  139. E8131,
  140. E8265,
  141. E8266,
  142. E8402,
  143. E8731,
  144. 3rd-party-local-module-not-gated,
  145. pep8-reserved-keywords
  146. # Disabled:
  147. # R* [refactoring suggestions & reports]
  148. # I0011 (locally-disabling)
  149. # I0012 (locally-enabling)
  150. # I0013 (file-ignored)
  151. # E0302 (unexpected-special-method-signature)
  152. # E0401 (import-error)
  153. # E1101 (no-member) [pylint isn't smart enough]
  154. # E1103 (maybe-no-member)
  155. # E1136 (unsubscriptable-object)
  156. # E1320 (un-indexed-curly-braces-error)
  157. # E8114 (indentation-is-not-a-multiple-of-four-comment)
  158. # C0102 (blacklisted-name) [because it activates C0103 too]
  159. # C0103 (invalid-name)
  160. # C0111 (missing-docstring)
  161. # C0113 (unneeded-not)
  162. # C0122 (misplaced-comparison-constant)
  163. # C0123 (unidiomatic-typecheck)
  164. # C0412 (ungrouped-imports)
  165. # C0203 (bad-mcs-method-argument)
  166. # C0204 (bad-mcs-classmethod-argument)
  167. # C0301 (line-too-long)
  168. # C0302 (too-many-lines)
  169. # C0330 (bad-continuation)
  170. # W0110 (deprecated-lambda)
  171. # W0122 (exec-statement)
  172. # W0142 (star-args)
  173. # W0201 (attribute-defined-outside-init) [done in several places in the codebase]
  174. # W0212 (protected-access)
  175. # W0404 (reimported) [done intentionally for legit reasons]
  176. # W0511 (fixme) [several outstanding instances currently in the codebase]
  177. # W0603 (global-statement)
  178. # W0612 (unused-variable) [unused return values]
  179. # W0613 (unused-argument)
  180. # W0621 (redefined-outer-name)
  181. # W0622 (redefined-builtin) [many parameter names shadow builtins]
  182. # W0631 (undefined-loop-variable) [~3 instances, seem to be okay]
  183. # W0704 (pointless-except) [misnomer; "ignores the exception" rather than "pointless"]
  184. # F0220 (unresolved-interface)
  185. # F0401 (import-error)
  186. # W1202 (logging-format-interpolation) Use % formatting in logging functions but pass the % parameters as arguments
  187. # W1307 (invalid-format-index) Using invalid lookup key '%s' in format specifier "0['%s']"
  188. #
  189. # E8116 PEP8 E116: unexpected indentation (comment)
  190. # E812* All PEP8 E12*
  191. # E8265 PEP8 E265 - block comment should start with "# "
  192. # E8266 PEP8 E266 - too many leading '#' for block comment
  193. # E8501 PEP8 line too long
  194. # E8402 module level import not at top of file
  195. # E8731 do not assign a lambda expression, use a def
  196. [REPORTS]
  197. # Set the output format. Available formats are text, parseable, colorized, msvs
  198. # (visual studio) and html. You can also give a reporter class, eg
  199. # mypackage.mymodule.MyReporterClass.
  200. output-format=text
  201. # Put messages in a separate file for each module / package specified on the
  202. # command line instead of printing them on stdout. Reports (if any) will be
  203. # written in a file name "pylint_global.[txt|html]".
  204. files-output=no
  205. # Tells whether to display a full report or only the messages
  206. # This will be removed in pylint 1.6
  207. reports=no
  208. # Python expression which should return a note less than 10 (10 is the highest
  209. # note). You have access to the variables errors warning, statement which
  210. # respectively contain the number of errors / warnings messages and the total
  211. # number of statements analyzed. This is used by the global evaluation report
  212. # (RP0004).
  213. evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
  214. # Template used to display messages. This is a python new-style format string
  215. # used to format the message information. See doc for all details
  216. #msg-template=
  217. msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'
  218. [VARIABLES]
  219. # Tells whether we should check for unused import in __init__ files.
  220. init-import=no
  221. # A regular expression matching the name of dummy variables (i.e. expectedly
  222. # not used).
  223. dummy-variables-rgx=_|dummy
  224. # List of additional names supposed to be defined in builtins. Remember that
  225. # you should avoid to define new builtins when possible.
  226. additional-builtins=__opts__,
  227. __utils__,
  228. __salt__,
  229. __pillar__,
  230. __grains__,
  231. __context__,
  232. __runner__,
  233. __ret__,
  234. __env__,
  235. __low__,
  236. __states__,
  237. __lowstate__,
  238. __running__,
  239. __active_provider_name__,
  240. __master_opts__,
  241. __jid_event__,
  242. __instance_id__,
  243. __salt_system_encoding__,
  244. __proxy__,
  245. __serializers__,
  246. __reg__,
  247. __events__
  248. # List of strings which can identify a callback function by name. A callback
  249. # name must start or end with one of those strings.
  250. callbacks=cb_,_cb
  251. [FORMAT]
  252. # Maximum number of characters on a single line.
  253. max-line-length=120
  254. # Regexp for a line that is allowed to be longer than the limit.
  255. ignore-long-lines=^\s*(# )?<?https?://\S+>?$
  256. # Allow the body of an if to be on the same line as the test if there is no
  257. # else.
  258. single-line-if-stmt=no
  259. # List of optional constructs for which whitespace checking is disabled
  260. no-space-check=trailing-comma,dict-separator
  261. # Maximum number of lines in a module
  262. max-module-lines=3000
  263. # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
  264. # tab).
  265. indent-string=' '
  266. # Number of spaces of indent required inside a hanging or continued line.
  267. indent-after-paren=4
  268. # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
  269. expected-line-ending-format=LF
  270. [LOGGING]
  271. # Logging modules to check that the string format arguments are in logging
  272. # function parameter format
  273. #logging-modules=logging
  274. #
  275. # Disabled because it not only complains about %s arguments but it also
  276. # complains about {0} arguments
  277. logging-modules=
  278. [TYPECHECK]
  279. # Tells whether missing members accessed in mixin class should be ignored. A
  280. # mixin class is detected if its name ends with "mixin" (case insensitive).
  281. ignore-mixin-members=yes
  282. # List of module names for which member attributes should not be checked
  283. # (useful for modules/projects where namespaces are manipulated during runtime
  284. # and thus existing member attributes cannot be deduced by static analysis
  285. ignored-modules=
  286. # List of classes names for which member attributes should not be checked
  287. # (useful for classes with attributes dynamically set).
  288. ignored-classes=SQLObject
  289. # List of members which are set dynamically and missed by pylint inference
  290. # system, and so shouldn't trigger E0201 when accessed. Python regular
  291. # expressions are accepted.
  292. generated-members=REQUEST,acl_users,aq_parent
  293. [MISCELLANEOUS]
  294. # List of note tags to take in consideration, separated by a comma.
  295. notes=FIXME,FIX,XXX,TODO
  296. [SIMILARITIES]
  297. # Minimum lines number of a similarity.
  298. min-similarity-lines=4
  299. # Ignore comments when computing similarities.
  300. ignore-comments=yes
  301. # Ignore docstrings when computing similarities.
  302. ignore-docstrings=yes
  303. # Ignore imports when computing similarities.
  304. ignore-imports=no
  305. [BASIC]
  306. # List of builtins function names that should not be used, separated by a comma
  307. bad-functions=map,filter,apply,input
  308. # Good variable names which should always be accepted, separated by a comma
  309. good-names=i,j,k,ex,Run,_,log
  310. # Bad variable names which should always be refused, separated by a comma
  311. bad-names=foo,bar,baz,toto,tutu,tata
  312. # Colon-delimited sets of names that determine each other's naming style when
  313. # the name regexes allow several styles.
  314. name-group=
  315. # Include a hint for the correct naming format with invalid-name
  316. include-naming-hint=no
  317. # Regular expression matching correct function names
  318. function-rgx=[a-z_][a-z0-9_]{2,30}$
  319. # Naming hint for function names
  320. function-name-hint=[a-z_][a-z0-9_]{2,30}$
  321. # Regular expression matching correct variable names
  322. variable-rgx=[a-z_][a-z0-9_]{2,30}$
  323. # Naming hint for variable names
  324. variable-name-hint=[a-z_][a-z0-9_]{2,30}$
  325. # Regular expression matching correct constant names
  326. const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
  327. # Naming hint for constant names
  328. const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
  329. # Regular expression matching correct attribute names
  330. attr-rgx=[a-z_][a-z0-9_]{2,30}$
  331. # Naming hint for attribute names
  332. attr-name-hint=[a-z_][a-z0-9_]{2,30}$
  333. # Regular expression matching correct argument names
  334. argument-rgx=[a-z_][a-z0-9_]{2,30}$
  335. # Naming hint for argument names
  336. argument-name-hint=[a-z_][a-z0-9_]{2,30}$
  337. # Regular expression matching correct class attribute names
  338. class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
  339. # Naming hint for class attribute names
  340. class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
  341. # Regular expression matching correct inline iteration names
  342. inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
  343. # Naming hint for inline iteration names
  344. inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
  345. # Regular expression matching correct class names
  346. class-rgx=[A-Z_][a-zA-Z0-9]+$
  347. # Naming hint for class names
  348. class-name-hint=[A-Z_][a-zA-Z0-9]+$
  349. # Regular expression matching correct module names
  350. module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  351. # Naming hint for module names
  352. module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  353. # Regular expression matching correct method names
  354. method-rgx=[a-z_][a-z0-9_]{2,30}$
  355. # Naming hint for method names
  356. method-name-hint=[a-z_][a-z0-9_]{2,30}$
  357. # Regular expression which should only match function or class names that do
  358. # not require a docstring.
  359. no-docstring-rgx=__.*__
  360. # Minimum line length for functions/classes that require docstrings, shorter
  361. # ones are exempt.
  362. docstring-min-length=-1
  363. [SPELLING]
  364. # Spelling dictionary name. Available dictionaries: none. To make it working
  365. # install python-enchant package.
  366. spelling-dict=
  367. # List of comma separated words that should not be checked.
  368. spelling-ignore-words=
  369. # A path to a file that contains private dictionary; one word per line.
  370. spelling-private-dict-file=
  371. # Tells whether to store unknown words to indicated private dictionary in
  372. # --spelling-private-dict-file option instead of raising a message.
  373. spelling-store-unknown-words=no
  374. [CLASSES]
  375. # List of method names used to declare (i.e. assign) instance attributes.
  376. defining-attr-methods=__init__,__new__,setUp
  377. # List of valid names for the first argument in a class method.
  378. valid-classmethod-first-arg=cls
  379. # List of valid names for the first argument in a metaclass class method.
  380. valid-metaclass-classmethod-first-arg=mcs
  381. # List of member names, which should be excluded from the protected access
  382. # warning.
  383. exclude-protected=_asdict,_fields,_replace,_source,_make
  384. [IMPORTS]
  385. # Deprecated modules which should not be used, separated by a comma
  386. deprecated-modules=regsub,TERMIOS,Bastion,rexec
  387. # Create a graph of every (i.e. internal and external) dependencies in the
  388. # given file (report RP0402 must not be disabled)
  389. import-graph=
  390. # Create a graph of external dependencies in the given file (report RP0402 must
  391. # not be disabled)
  392. ext-import-graph=
  393. # Create a graph of internal dependencies in the given file (report RP0402 must
  394. # not be disabled)
  395. int-import-graph=
  396. [DESIGN]
  397. # Maximum number of arguments for function / method
  398. max-args=35
  399. # Argument names that match this expression will be ignored. Default to name
  400. # with leading underscore
  401. ignored-argument-names=_.*
  402. # Maximum number of locals for function / method body
  403. max-locals=40
  404. # Maximum number of return / yield for function / method body
  405. max-returns=6
  406. # Maximum number of branch for function / method body
  407. # We create a lot of branches in salt, 4x the default value
  408. max-branches=48
  409. # Maximum number of statements in function / method body
  410. max-statements=100
  411. # Maximum number of parents for a class (see R0901).
  412. max-parents=7
  413. # Maximum number of attributes for a class (see R0902).
  414. max-attributes=7
  415. # Minimum number of public methods for a class (see R0903).
  416. min-public-methods=2
  417. # Maximum number of public methods for a class (see R0904).
  418. max-public-methods=20
  419. [EXCEPTIONS]
  420. # Exceptions that will emit a warning when being caught. Defaults to
  421. # "Exception"
  422. overgeneral-exceptions=BaseException