.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. # Use multiple processes to speed up Pylint.
  24. # Don't bump this values on PyLint 1.4.0 - Know bug that ignores the passed --rcfile
  25. jobs=1
  26. # List of blacklisted functions and suggested replacements
  27. #
  28. # NOTE: This pylint check will infer the full name of the function by walking
  29. # back up from the function name to the parent, to the parent's parent, etc.,
  30. # and this means that functions which come from platform-specific modules need
  31. # to be referenced using name of the module from which the function was
  32. # imported. This happens a lot in the os and os.path modules. Functions from
  33. # os.path should be defined using posixpath.funcname and ntpath.funcname, while
  34. # functions from os should be defined using posix.funcname and nt.funcname.
  35. #
  36. # When defining a blacklisted function, the format is:
  37. #
  38. # <func_name>=<suggested_replacement>
  39. #
  40. # The replacement text will be included in the alert message.
  41. #
  42. blacklisted-functions=posix.umask=salt.utils.files.set_umask or get_umask,
  43. nt.umask=salt.utils.files.set_umask or get_umask
  44. # Allow loading of arbitrary C extensions. Extensions are imported into the
  45. # active Python interpreter and may run arbitrary code.
  46. unsafe-load-any-extension=no
  47. # A comma-separated list of package or module names from where C extensions may
  48. # be loaded. Extensions are loading into the active Python interpreter and may
  49. # run arbitrary code
  50. extension-pkg-whitelist=
  51. # Fileperms Lint Plugin Settings
  52. fileperms-default=0644
  53. fileperms-ignore-paths=setup.py,tests/runtests.py,tests/jenkins*.py,tests/saltsh.py,tests/buildpackage.py
  54. # Minimum Python Version To Enforce
  55. minimum-python-version = 2.7
  56. # Allowed 3rd-party package imports
  57. allowed-3rd-party-modules = msgpack,
  58. tornado,
  59. yaml,
  60. jinja2,
  61. Crypto,
  62. requests,
  63. libcloud,
  64. zmq,
  65. pytest,
  66. pytestsalt
  67. [MESSAGES CONTROL]
  68. # Only show warnings with the listed confidence levels. Leave empty to show
  69. # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
  70. confidence=
  71. # Enable the message, report, category or checker with the given id(s). You can
  72. # either give multiple identifier separated by comma (,) or put this option
  73. # multiple time. See also the "--disable" option for examples.
  74. #enable=
  75. # Disable the message, report, category or checker with the given id(s). You
  76. # can either give multiple identifiers separated by comma (,) or put this
  77. # option multiple times (only on the command line, not in the configuration
  78. # file where it should appear only once).You can also use "--disable=all" to
  79. # disable everything first and then re-enable specific checks. For example, if
  80. # you want to run only the similarities checker, you can use "--disable=all
  81. # --enable=similarities". If you want to run only the classes checker, but have
  82. # no Warning level messages displayed, use"--disable=all --enable=classes
  83. # --disable=W"
  84. disable=R,
  85. I0011,
  86. I0012,
  87. I0013,
  88. E0302,
  89. E0401,
  90. E1101,
  91. E1103,
  92. E1136,
  93. E1320,
  94. E8114,
  95. C0102,
  96. C0103,
  97. C0111,
  98. C0112,
  99. C0122,
  100. C0123,
  101. C0411,
  102. C0412,
  103. C0413,
  104. C0203,
  105. C0204,
  106. C0301,
  107. C0302,
  108. C0330,
  109. W0110,
  110. W0122,
  111. W0142,
  112. W0201,
  113. W0212,
  114. W0404,
  115. W0511,
  116. W0603,
  117. W0612,
  118. W0613,
  119. W0621,
  120. W0622,
  121. W0631,
  122. W0704,
  123. W1202,
  124. W1307,
  125. F0220,
  126. F0401,
  127. E8501,
  128. E8116,
  129. E8121,
  130. E8122,
  131. E8123,
  132. E8124,
  133. E8125,
  134. E8126,
  135. E8127,
  136. E8128,
  137. E8129,
  138. E8131,
  139. E8265,
  140. E8266,
  141. E8402,
  142. E8731,
  143. 3rd-party-local-module-not-gated,
  144. pep8-reserved-keywords
  145. # Disabled:
  146. # R* [refactoring suggestions & reports]
  147. # I0011 (locally-disabling)
  148. # I0012 (locally-enabling)
  149. # I0013 (file-ignored)
  150. # E0302 (unexpected-special-method-signature)
  151. # E0401 (import-error)
  152. # E1101 (no-member) [pylint isn't smart enough]
  153. # E1103 (maybe-no-member)
  154. # E1136 (unsubscriptable-object)
  155. # E1320 (un-indexed-curly-braces-error)
  156. # E8114 (indentation-is-not-a-multiple-of-four-comment)
  157. # C0102 (blacklisted-name) [because it activates C0103 too]
  158. # C0103 (invalid-name)
  159. # C0111 (missing-docstring)
  160. # C0113 (unneeded-not)
  161. # C0122 (misplaced-comparison-constant)
  162. # C0123 (unidiomatic-typecheck)
  163. # C0412 (ungrouped-imports)
  164. # C0203 (bad-mcs-method-argument)
  165. # C0204 (bad-mcs-classmethod-argument)
  166. # C0301 (line-too-long)
  167. # C0302 (too-many-lines)
  168. # C0330 (bad-continuation)
  169. # W0110 (deprecated-lambda)
  170. # W0122 (exec-statement)
  171. # W0142 (star-args)
  172. # W0201 (attribute-defined-outside-init) [done in several places in the codebase]
  173. # W0212 (protected-access)
  174. # W0404 (reimported) [done intentionally for legit reasons]
  175. # W0511 (fixme) [several outstanding instances currently in the codebase]
  176. # W0603 (global-statement)
  177. # W0612 (unused-variable) [unused return values]
  178. # W0613 (unused-argument)
  179. # W0621 (redefined-outer-name)
  180. # W0622 (redefined-builtin) [many parameter names shadow builtins]
  181. # W0631 (undefined-loop-variable) [~3 instances, seem to be okay]
  182. # W0704 (pointless-except) [misnomer; "ignores the exception" rather than "pointless"]
  183. # F0220 (unresolved-interface)
  184. # F0401 (import-error)
  185. # W1202 (logging-format-interpolation) Use % formatting in logging functions but pass the % parameters as arguments
  186. # W1307 (invalid-format-index) Using invalid lookup key '%s' in format specifier "0['%s']"
  187. #
  188. # E8116 PEP8 E116: unexpected indentation (comment)
  189. # E812* All PEP8 E12*
  190. # E8265 PEP8 E265 - block comment should start with "# "
  191. # E8266 PEP8 E266 - too many leading '#' for block comment
  192. # E8501 PEP8 line too long
  193. # E8402 module level import not at top of file
  194. # E8731 do not assign a lambda expression, use a def
  195. [REPORTS]
  196. # Set the output format. Available formats are text, parseable, colorized, msvs
  197. # (visual studio) and html. You can also give a reporter class, eg
  198. # mypackage.mymodule.MyReporterClass.
  199. output-format=text
  200. # Put messages in a separate file for each module / package specified on the
  201. # command line instead of printing them on stdout. Reports (if any) will be
  202. # written in a file name "pylint_global.[txt|html]".
  203. files-output=no
  204. # Tells whether to display a full report or only the messages
  205. # This will be removed in pylint 1.6
  206. reports=no
  207. # Python expression which should return a note less than 10 (10 is the highest
  208. # note). You have access to the variables errors warning, statement which
  209. # respectively contain the number of errors / warnings messages and the total
  210. # number of statements analyzed. This is used by the global evaluation report
  211. # (RP0004).
  212. evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
  213. # Template used to display messages. This is a python new-style format string
  214. # used to format the message information. See doc for all details
  215. #msg-template=
  216. msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'
  217. [VARIABLES]
  218. # Tells whether we should check for unused import in __init__ files.
  219. init-import=no
  220. # A regular expression matching the name of dummy variables (i.e. expectedly
  221. # not used).
  222. dummy-variables-rgx=_|dummy
  223. # List of additional names supposed to be defined in builtins. Remember that
  224. # you should avoid to define new builtins when possible.
  225. additional-builtins=__opts__,
  226. __utils__,
  227. __salt__,
  228. __pillar__,
  229. __grains__,
  230. __context__,
  231. __runner__,
  232. __ret__,
  233. __env__,
  234. __low__,
  235. __states__,
  236. __lowstate__,
  237. __running__,
  238. __active_provider_name__,
  239. __master_opts__,
  240. __jid_event__,
  241. __instance_id__,
  242. __salt_system_encoding__,
  243. __proxy__,
  244. __serializers__,
  245. __reg__,
  246. __executors__,
  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