.testing.pylintrc 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  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. # Disabled:
  145. # R* [refactoring suggestions & reports]
  146. # I0011 (locally-disabling)
  147. # I0012 (locally-enabling)
  148. # I0013 (file-ignored)
  149. # E0302 (unexpected-special-method-signature)
  150. # E0401 (import-error)
  151. # E1101 (no-member) [pylint isn't smart enough]
  152. # E1103 (maybe-no-member)
  153. # E1136 (unsubscriptable-object)
  154. # E1320 (un-indexed-curly-braces-error)
  155. # E8114 (indentation-is-not-a-multiple-of-four-comment)
  156. # C0102 (blacklisted-name) [because it activates C0103 too]
  157. # C0103 (invalid-name)
  158. # C0111 (missing-docstring)
  159. # C0113 (unneeded-not)
  160. # C0122 (misplaced-comparison-constant)
  161. # C0123 (unidiomatic-typecheck)
  162. # C0412 (ungrouped-imports)
  163. # C0203 (bad-mcs-method-argument)
  164. # C0204 (bad-mcs-classmethod-argument)
  165. # C0301 (line-too-long)
  166. # C0302 (too-many-lines)
  167. # C0330 (bad-continuation)
  168. # W0110 (deprecated-lambda)
  169. # W0122 (exec-statement)
  170. # W0142 (star-args)
  171. # W0201 (attribute-defined-outside-init) [done in several places in the codebase]
  172. # W0212 (protected-access)
  173. # W0404 (reimported) [done intentionally for legit reasons]
  174. # W0511 (fixme) [several outstanding instances currently in the codebase]
  175. # W0603 (global-statement)
  176. # W0612 (unused-variable) [unused return values]
  177. # W0613 (unused-argument)
  178. # W0621 (redefined-outer-name)
  179. # W0622 (redefined-builtin) [many parameter names shadow builtins]
  180. # W0631 (undefined-loop-variable) [~3 instances, seem to be okay]
  181. # W0704 (pointless-except) [misnomer; "ignores the exception" rather than "pointless"]
  182. # F0220 (unresolved-interface)
  183. # F0401 (import-error)
  184. # W1202 (logging-format-interpolation) Use % formatting in logging functions but pass the % parameters as arguments
  185. # W1307 (invalid-format-index) Using invalid lookup key '%s' in format specifier "0['%s']"
  186. #
  187. # E8116 PEP8 E116: unexpected indentation (comment)
  188. # E812* All PEP8 E12*
  189. # E8265 PEP8 E265 - block comment should start with "# "
  190. # E8266 PEP8 E266 - too many leading '#' for block comment
  191. # E8501 PEP8 line too long
  192. # E8402 module level import not at top of file
  193. # E8731 do not assign a lambda expression, use a def
  194. [REPORTS]
  195. # Set the output format. Available formats are text, parseable, colorized, msvs
  196. # (visual studio) and html. You can also give a reporter class, eg
  197. # mypackage.mymodule.MyReporterClass.
  198. output-format=text
  199. # Put messages in a separate file for each module / package specified on the
  200. # command line instead of printing them on stdout. Reports (if any) will be
  201. # written in a file name "pylint_global.[txt|html]".
  202. files-output=no
  203. # Tells whether to display a full report or only the messages
  204. # This will be removed in pylint 1.6
  205. reports=no
  206. # Python expression which should return a note less than 10 (10 is the highest
  207. # note). You have access to the variables errors warning, statement which
  208. # respectively contain the number of errors / warnings messages and the total
  209. # number of statements analyzed. This is used by the global evaluation report
  210. # (RP0004).
  211. evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
  212. # Template used to display messages. This is a python new-style format string
  213. # used to format the message information. See doc for all details
  214. #msg-template=
  215. msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'
  216. [VARIABLES]
  217. # Tells whether we should check for unused import in __init__ files.
  218. init-import=no
  219. # A regular expression matching the name of dummy variables (i.e. expectedly
  220. # not used).
  221. dummy-variables-rgx=_|dummy
  222. # List of additional names supposed to be defined in builtins. Remember that
  223. # you should avoid to define new builtins when possible.
  224. additional-builtins=__opts__,
  225. __utils__,
  226. __salt__,
  227. __pillar__,
  228. __grains__,
  229. __context__,
  230. __runner__,
  231. __ret__,
  232. __env__,
  233. __low__,
  234. __states__,
  235. __lowstate__,
  236. __running__,
  237. __active_provider_name__,
  238. __master_opts__,
  239. __jid_event__,
  240. __instance_id__,
  241. __salt_system_encoding__,
  242. __proxy__,
  243. __serializers__,
  244. __reg__,
  245. __executors__,
  246. __events__
  247. # List of strings which can identify a callback function by name. A callback
  248. # name must start or end with one of those strings.
  249. callbacks=cb_,_cb
  250. [FORMAT]
  251. # Maximum number of characters on a single line.
  252. max-line-length=120
  253. # Regexp for a line that is allowed to be longer than the limit.
  254. ignore-long-lines=^\s*(# )?<?https?://\S+>?$
  255. # Allow the body of an if to be on the same line as the test if there is no
  256. # else.
  257. single-line-if-stmt=no
  258. # List of optional constructs for which whitespace checking is disabled
  259. no-space-check=trailing-comma,dict-separator
  260. # Maximum number of lines in a module
  261. max-module-lines=3000
  262. # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
  263. # tab).
  264. indent-string=' '
  265. # Number of spaces of indent required inside a hanging or continued line.
  266. indent-after-paren=4
  267. # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
  268. expected-line-ending-format=LF
  269. [LOGGING]
  270. # Logging modules to check that the string format arguments are in logging
  271. # function parameter format
  272. #logging-modules=logging
  273. #
  274. # Disabled because it not only complains about %s arguments but it also
  275. # complains about {0} arguments
  276. logging-modules=
  277. [TYPECHECK]
  278. # Tells whether missing members accessed in mixin class should be ignored. A
  279. # mixin class is detected if its name ends with "mixin" (case insensitive).
  280. ignore-mixin-members=yes
  281. # List of module names for which member attributes should not be checked
  282. # (useful for modules/projects where namespaces are manipulated during runtime
  283. # and thus existing member attributes cannot be deduced by static analysis
  284. ignored-modules=
  285. # List of classes names for which member attributes should not be checked
  286. # (useful for classes with attributes dynamically set).
  287. ignored-classes=SQLObject
  288. # List of members which are set dynamically and missed by pylint inference
  289. # system, and so shouldn't trigger E0201 when accessed. Python regular
  290. # expressions are accepted.
  291. generated-members=REQUEST,acl_users,aq_parent
  292. [MISCELLANEOUS]
  293. # List of note tags to take in consideration, separated by a comma.
  294. notes=FIXME,FIX,XXX,TODO
  295. [SIMILARITIES]
  296. # Minimum lines number of a similarity.
  297. min-similarity-lines=4
  298. # Ignore comments when computing similarities.
  299. ignore-comments=yes
  300. # Ignore docstrings when computing similarities.
  301. ignore-docstrings=yes
  302. # Ignore imports when computing similarities.
  303. ignore-imports=no
  304. [BASIC]
  305. # List of builtins function names that should not be used, separated by a comma
  306. bad-functions=map,filter,apply,input
  307. # Good variable names which should always be accepted, separated by a comma
  308. good-names=i,j,k,ex,Run,_,log
  309. # Bad variable names which should always be refused, separated by a comma
  310. bad-names=foo,bar,baz,toto,tutu,tata
  311. # Colon-delimited sets of names that determine each other's naming style when
  312. # the name regexes allow several styles.
  313. name-group=
  314. # Include a hint for the correct naming format with invalid-name
  315. include-naming-hint=no
  316. # Regular expression matching correct function names
  317. function-rgx=[a-z_][a-z0-9_]{2,30}$
  318. # Naming hint for function names
  319. function-name-hint=[a-z_][a-z0-9_]{2,30}$
  320. # Regular expression matching correct variable names
  321. variable-rgx=[a-z_][a-z0-9_]{2,30}$
  322. # Naming hint for variable names
  323. variable-name-hint=[a-z_][a-z0-9_]{2,30}$
  324. # Regular expression matching correct constant names
  325. const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
  326. # Naming hint for constant names
  327. const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
  328. # Regular expression matching correct attribute names
  329. attr-rgx=[a-z_][a-z0-9_]{2,30}$
  330. # Naming hint for attribute names
  331. attr-name-hint=[a-z_][a-z0-9_]{2,30}$
  332. # Regular expression matching correct argument names
  333. argument-rgx=[a-z_][a-z0-9_]{2,30}$
  334. # Naming hint for argument names
  335. argument-name-hint=[a-z_][a-z0-9_]{2,30}$
  336. # Regular expression matching correct class attribute names
  337. class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
  338. # Naming hint for class attribute names
  339. class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
  340. # Regular expression matching correct inline iteration names
  341. inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
  342. # Naming hint for inline iteration names
  343. inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
  344. # Regular expression matching correct class names
  345. class-rgx=[A-Z_][a-zA-Z0-9]+$
  346. # Naming hint for class names
  347. class-name-hint=[A-Z_][a-zA-Z0-9]+$
  348. # Regular expression matching correct module names
  349. module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  350. # Naming hint for module names
  351. module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  352. # Regular expression matching correct method names
  353. method-rgx=[a-z_][a-z0-9_]{2,30}$
  354. # Naming hint for method names
  355. method-name-hint=[a-z_][a-z0-9_]{2,30}$
  356. # Regular expression which should only match function or class names that do
  357. # not require a docstring.
  358. no-docstring-rgx=__.*__
  359. # Minimum line length for functions/classes that require docstrings, shorter
  360. # ones are exempt.
  361. docstring-min-length=-1
  362. [SPELLING]
  363. # Spelling dictionary name. Available dictionaries: none. To make it working
  364. # install python-enchant package.
  365. spelling-dict=
  366. # List of comma separated words that should not be checked.
  367. spelling-ignore-words=
  368. # A path to a file that contains private dictionary; one word per line.
  369. spelling-private-dict-file=
  370. # Tells whether to store unknown words to indicated private dictionary in
  371. # --spelling-private-dict-file option instead of raising a message.
  372. spelling-store-unknown-words=no
  373. [CLASSES]
  374. # List of method names used to declare (i.e. assign) instance attributes.
  375. defining-attr-methods=__init__,__new__,setUp
  376. # List of valid names for the first argument in a class method.
  377. valid-classmethod-first-arg=cls
  378. # List of valid names for the first argument in a metaclass class method.
  379. valid-metaclass-classmethod-first-arg=mcs
  380. # List of member names, which should be excluded from the protected access
  381. # warning.
  382. exclude-protected=_asdict,_fields,_replace,_source,_make
  383. [IMPORTS]
  384. # Deprecated modules which should not be used, separated by a comma
  385. deprecated-modules=regsub,TERMIOS,Bastion,rexec
  386. # Create a graph of every (i.e. internal and external) dependencies in the
  387. # given file (report RP0402 must not be disabled)
  388. import-graph=
  389. # Create a graph of external dependencies in the given file (report RP0402 must
  390. # not be disabled)
  391. ext-import-graph=
  392. # Create a graph of internal dependencies in the given file (report RP0402 must
  393. # not be disabled)
  394. int-import-graph=
  395. [DESIGN]
  396. # Maximum number of arguments for function / method
  397. max-args=35
  398. # Argument names that match this expression will be ignored. Default to name
  399. # with leading underscore
  400. ignored-argument-names=_.*
  401. # Maximum number of locals for function / method body
  402. max-locals=40
  403. # Maximum number of return / yield for function / method body
  404. max-returns=6
  405. # Maximum number of branch for function / method body
  406. # We create a lot of branches in salt, 4x the default value
  407. max-branches=48
  408. # Maximum number of statements in function / method body
  409. max-statements=100
  410. # Maximum number of parents for a class (see R0901).
  411. max-parents=7
  412. # Maximum number of attributes for a class (see R0902).
  413. max-attributes=7
  414. # Minimum number of public methods for a class (see R0903).
  415. min-public-methods=2
  416. # Maximum number of public methods for a class (see R0904).
  417. max-public-methods=20
  418. [EXCEPTIONS]
  419. # Exceptions that will emit a warning when being caught. Defaults to
  420. # "Exception"
  421. overgeneral-exceptions=BaseException