.pylintrc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. # Based on Apache 2.0 licensed code from https://github.com/ClusterHQ/flocker
  2. [MASTER]
  3. # Specify a configuration file.
  4. #rcfile=
  5. # Python code to execute, usually for sys.path manipulation such as
  6. # pygtk.require().
  7. init-hook="from pylint.config import find_pylintrc; import os, sys; sys.path.append(os.path.dirname(find_pylintrc()))"
  8. # Add files or directories to the blacklist. They should be base names, not
  9. # paths.
  10. ignore=
  11. # Pickle collected data for later comparisons.
  12. persistent=no
  13. # List of plugins (as comma separated values of python modules names) to load,
  14. # usually to register additional checkers.
  15. load-plugins=
  16. # Use multiple processes to speed up Pylint.
  17. # DO NOT CHANGE THIS VALUES >1 HIDE RESULTS!!!!!
  18. jobs=1
  19. # Allow loading of arbitrary C extensions. Extensions are imported into the
  20. # active Python interpreter and may run arbitrary code.
  21. unsafe-load-any-extension=no
  22. # A comma-separated list of package or module names from where C extensions may
  23. # be loaded. Extensions are loading into the active Python interpreter and may
  24. # run arbitrary code
  25. extension-pkg-whitelist=
  26. # Allow optimization of some AST trees. This will activate a peephole AST
  27. # optimizer, which will apply various small optimizations. For instance, it can
  28. # be used to obtain the result of joining multiple strings with the addition
  29. # operator. Joining a lot of strings can lead to a maximum recursion error in
  30. # Pylint and this flag can prevent that. It has one side effect, the resulting
  31. # AST will be different than the one from reality.
  32. optimize-ast=no
  33. [MESSAGES CONTROL]
  34. # Only show warnings with the listed confidence levels. Leave empty to show
  35. # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
  36. confidence=
  37. # Enable the message, report, category or checker with the given id(s). You can
  38. # either give multiple identifier separated by comma (,) or put this option
  39. # multiple time. See also the "--disable" option for examples.
  40. disable=all
  41. enable=import-error,
  42. import-self,
  43. reimported,
  44. wildcard-import,
  45. misplaced-future,
  46. deprecated-module,
  47. unpacking-non-sequence,
  48. invalid-all-object,
  49. undefined-all-variable,
  50. used-before-assignment,
  51. cell-var-from-loop,
  52. global-variable-undefined,
  53. redefine-in-handler,
  54. unused-import,
  55. unused-wildcard-import,
  56. global-variable-not-assigned,
  57. undefined-loop-variable,
  58. global-at-module-level,
  59. bad-open-mode,
  60. redundant-unittest-assert,
  61. boolean-datetime
  62. deprecated-method,
  63. anomalous-unicode-escape-in-string,
  64. anomalous-backslash-in-string,
  65. not-in-loop,
  66. continue-in-finally,
  67. abstract-class-instantiated,
  68. star-needs-assignment-target,
  69. duplicate-argument-name,
  70. return-in-init,
  71. too-many-star-expressions,
  72. nonlocal-and-global,
  73. return-outside-function,
  74. return-arg-in-generator,
  75. invalid-star-assignment-target,
  76. bad-reversed-sequence,
  77. nonexistent-operator,
  78. yield-outside-function,
  79. init-is-generator,
  80. nonlocal-without-binding,
  81. lost-exception,
  82. assert-on-tuple,
  83. dangerous-default-value,
  84. duplicate-key,
  85. useless-else-on-loop
  86. expression-not-assigned,
  87. confusing-with-statement,
  88. unnecessary-lambda,
  89. pointless-statement,
  90. pointless-string-statement,
  91. unnecessary-pass,
  92. unreachable,
  93. using-constant-test,
  94. bad-super-call,
  95. missing-super-argument,
  96. slots-on-old-class,
  97. super-on-old-class,
  98. property-on-old-class,
  99. not-an-iterable,
  100. not-a-mapping,
  101. format-needs-mapping,
  102. truncated-format-string,
  103. missing-format-string-key,
  104. mixed-format-string,
  105. too-few-format-args,
  106. bad-str-strip-call,
  107. too-many-format-args,
  108. bad-format-character,
  109. format-combined-specification,
  110. bad-format-string-key,
  111. bad-format-string,
  112. missing-format-attribute,
  113. missing-format-argument-key,
  114. unused-format-string-argument
  115. unused-format-string-key,
  116. invalid-format-index,
  117. bad-indentation,
  118. mixed-indentation,
  119. unnecessary-semicolon,
  120. lowercase-l-suffix,
  121. invalid-encoded-data,
  122. unpacking-in-except,
  123. import-star-module-level,
  124. long-suffix,
  125. old-octal-literal,
  126. old-ne-operator,
  127. backtick,
  128. old-raise-syntax,
  129. metaclass-assignment,
  130. next-method-called,
  131. dict-iter-method,
  132. dict-view-method,
  133. indexing-exception,
  134. raising-string,
  135. using-cmp-argument,
  136. cmp-method,
  137. coerce-method,
  138. delslice-method,
  139. getslice-method,
  140. hex-method,
  141. nonzero-method,
  142. t-method,
  143. setslice-method,
  144. old-division,
  145. logging-format-truncated,
  146. logging-too-few-args,
  147. logging-too-many-args,
  148. logging-unsupported-format,
  149. logging-format-interpolation,
  150. invalid-unary-operand-type,
  151. unsupported-binary-operation,
  152. not-callable,
  153. redundant-keyword-arg,
  154. assignment-from-no-return,
  155. assignment-from-none,
  156. not-context-manager,
  157. repeated-keyword,
  158. missing-kwoa,
  159. no-value-for-parameter,
  160. invalid-sequence-index,
  161. invalid-slice-index,
  162. unexpected-keyword-arg,
  163. unsupported-membership-test,
  164. unsubscriptable-object,
  165. access-member-before-definition,
  166. method-hidden,
  167. assigning-non-slot,
  168. duplicate-bases,
  169. inconsistent-mro,
  170. inherit-non-class,
  171. invalid-slots,
  172. invalid-slots-object,
  173. no-method-argument,
  174. no-self-argument,
  175. unexpected-special-method-signature,
  176. non-iterator-returned,
  177. arguments-differ,
  178. signature-differs,
  179. bad-staticmethod-argument,
  180. non-parent-init-called,
  181. bad-except-order,
  182. catching-non-exception,
  183. bad-exception-context,
  184. notimplemented-raised,
  185. raising-bad-type,
  186. raising-non-exception,
  187. misplaced-bare-raise,
  188. duplicate-except,
  189. nonstandard-exception,
  190. binary-op-exception,
  191. not-async-context-manager,
  192. yield-inside-async-function
  193. # Needs investigation:
  194. # abstract-method (might be indicating a bug? probably not though)
  195. # protected-access (requires some refactoring)
  196. # attribute-defined-outside-init (requires some refactoring)
  197. # super-init-not-called (requires some cleanup)
  198. # Things we'd like to enable someday:
  199. # redefined-builtin (requires a bunch of work to clean up our code first)
  200. # redefined-outer-name (requires a bunch of work to clean up our code first)
  201. # undefined-variable (re-enable when pylint fixes https://github.com/PyCQA/pylint/issues/760)
  202. # no-name-in-module (giving us spurious warnings https://github.com/PyCQA/pylint/issues/73)
  203. # unused-argument (need to clean up or code a lot, e.g. prefix unused_?)
  204. # function-redefined (@overload causes lots of spurious warnings)
  205. # too-many-function-args (@overload causes spurious warnings... I think)
  206. # parameter-unpacking (needed for eventual Python 3 compat)
  207. # print-statement (needed for eventual Python 3 compat)
  208. # filter-builtin-not-iterating (Python 3)
  209. # map-builtin-not-iterating (Python 3)
  210. # range-builtin-not-iterating (Python 3)
  211. # zip-builtin-not-iterating (Python 3)
  212. # many others relevant to Python 3
  213. # unused-variable (a little work to cleanup, is all)
  214. # ...
  215. [REPORTS]
  216. # Set the output format. Available formats are text, parseable, colorized, msvs
  217. # (visual studio) and html. You can also give a reporter class, eg
  218. # mypackage.mymodule.MyReporterClass.
  219. output-format=parseable
  220. # Put messages in a separate file for each module / package specified on the
  221. # command line instead of printing them on stdout. Reports (if any) will be
  222. # written in a file name "pylint_global.[txt|html]".
  223. files-output=no
  224. # Tells whether to display a full report or only the messages
  225. reports=no
  226. # Python expression which should return a note less than 10 (10 is the highest
  227. # note). You have access to the variables errors warning, statement which
  228. # respectively contain the number of errors / warnings messages and the total
  229. # number of statements analyzed. This is used by the global evaluation report
  230. # (RP0004).
  231. evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
  232. # Template used to display messages. This is a python new-style format string
  233. # used to format the message information. See doc for all details
  234. #msg-template=
  235. [LOGGING]
  236. # Logging modules to check that the string format arguments are in logging
  237. # function parameter format
  238. logging-modules=logging
  239. [FORMAT]
  240. # Maximum number of characters on a single line.
  241. max-line-length=100
  242. # Regexp for a line that is allowed to be longer than the limit.
  243. ignore-long-lines=^\s*(# )?<?https?://\S+>?$
  244. # Allow the body of an if to be on the same line as the test if there is no
  245. # else.
  246. single-line-if-stmt=no
  247. # List of optional constructs for which whitespace checking is disabled. `dict-
  248. # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
  249. # `trailing-comma` allows a space between comma and closing bracket: (a, ).
  250. # `empty-line` allows space-only lines.
  251. no-space-check=trailing-comma,dict-separator
  252. # Maximum number of lines in a module
  253. max-module-lines=1000
  254. # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
  255. # tab).
  256. indent-string=' '
  257. # Number of spaces of indent required inside a hanging or continued line.
  258. indent-after-paren=4
  259. # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
  260. expected-line-ending-format=
  261. [TYPECHECK]
  262. # Tells whether missing members accessed in mixin class should be ignored. A
  263. # mixin class is detected if its name ends with "mixin" (case insensitive).
  264. ignore-mixin-members=yes
  265. # List of module names for which member attributes should not be checked
  266. # (useful for modules/projects where namespaces are manipulated during runtime
  267. # and thus existing member attributes cannot be deduced by static analysis. It
  268. # supports qualified module names, as well as Unix pattern matching.
  269. ignored-modules=thirdparty.six.moves
  270. # List of classes names for which member attributes should not be checked
  271. # (useful for classes with attributes dynamically set). This supports can work
  272. # with qualified names.
  273. ignored-classes=
  274. # List of members which are set dynamically and missed by pylint inference
  275. # system, and so shouldn't trigger E1101 when accessed. Python regular
  276. # expressions are accepted.
  277. generated-members=
  278. [VARIABLES]
  279. # Tells whether we should check for unused import in __init__ files.
  280. init-import=no
  281. # A regular expression matching the name of dummy variables (i.e. expectedly
  282. # not used).
  283. dummy-variables-rgx=_$|dummy
  284. # List of additional names supposed to be defined in builtins. Remember that
  285. # you should avoid to define new builtins when possible.
  286. additional-builtins=
  287. # List of strings which can identify a callback function by name. A callback
  288. # name must start or end with one of those strings.
  289. callbacks=cb_,_cb
  290. [SIMILARITIES]
  291. # Minimum lines number of a similarity.
  292. min-similarity-lines=4
  293. # Ignore comments when computing similarities.
  294. ignore-comments=yes
  295. # Ignore docstrings when computing similarities.
  296. ignore-docstrings=yes
  297. # Ignore imports when computing similarities.
  298. ignore-imports=no
  299. [SPELLING]
  300. # Spelling dictionary name. Available dictionaries: none. To make it working
  301. # install python-enchant package.
  302. spelling-dict=
  303. # List of comma separated words that should not be checked.
  304. spelling-ignore-words=
  305. # A path to a file that contains private dictionary; one word per line.
  306. spelling-private-dict-file=
  307. # Tells whether to store unknown words to indicated private dictionary in
  308. # --spelling-private-dict-file option instead of raising a message.
  309. spelling-store-unknown-words=no
  310. [MISCELLANEOUS]
  311. # List of note tags to take in consideration, separated by a comma.
  312. notes=FIXME,XXX,TODO
  313. [BASIC]
  314. # List of builtins function names that should not be used, separated by a comma
  315. bad-functions=map,filter,input
  316. # Good variable names which should always be accepted, separated by a comma
  317. good-names=i,j,k,ex,Run,_
  318. # Bad variable names which should always be refused, separated by a comma
  319. bad-names=foo,bar,baz,toto,tutu,tata
  320. # Colon-delimited sets of names that determine each other's naming style when
  321. # the name regexes allow several styles.
  322. name-group=
  323. # Include a hint for the correct naming format with invalid-name
  324. include-naming-hint=no
  325. # Regular expression matching correct function names
  326. function-rgx=[a-z_][a-z0-9_]{2,30}$
  327. # Naming hint for function names
  328. function-name-hint=[a-z_][a-z0-9_]{2,30}$
  329. # Regular expression matching correct variable names
  330. variable-rgx=[a-z_][a-z0-9_]{2,30}$
  331. # Naming hint for variable names
  332. variable-name-hint=[a-z_][a-z0-9_]{2,30}$
  333. # Regular expression matching correct constant names
  334. const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
  335. # Naming hint for constant names
  336. const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
  337. # Regular expression matching correct attribute names
  338. attr-rgx=[a-z_][a-z0-9_]{2,30}$
  339. # Naming hint for attribute names
  340. attr-name-hint=[a-z_][a-z0-9_]{2,30}$
  341. # Regular expression matching correct argument names
  342. argument-rgx=[a-z_][a-z0-9_]{2,30}$
  343. # Naming hint for argument names
  344. argument-name-hint=[a-z_][a-z0-9_]{2,30}$
  345. # Regular expression matching correct class attribute names
  346. class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
  347. # Naming hint for class attribute names
  348. class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
  349. # Regular expression matching correct inline iteration names
  350. inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
  351. # Naming hint for inline iteration names
  352. inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
  353. # Regular expression matching correct class names
  354. class-rgx=[A-Z_][a-zA-Z0-9]+$
  355. # Naming hint for class names
  356. class-name-hint=[A-Z_][a-zA-Z0-9]+$
  357. # Regular expression matching correct module names
  358. module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  359. # Naming hint for module names
  360. module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  361. # Regular expression matching correct method names
  362. method-rgx=[a-z_][a-z0-9_]{2,30}$
  363. # Naming hint for method names
  364. method-name-hint=[a-z_][a-z0-9_]{2,30}$
  365. # Regular expression which should only match function or class names that do
  366. # not require a docstring.
  367. no-docstring-rgx=^_
  368. # Minimum line length for functions/classes that require docstrings, shorter
  369. # ones are exempt.
  370. docstring-min-length=-1
  371. [ELIF]
  372. # Maximum number of nested blocks for function / method body
  373. max-nested-blocks=5
  374. [IMPORTS]
  375. # Deprecated modules which should not be used, separated by a comma
  376. deprecated-modules=regsub,TERMIOS,Bastion,rexec
  377. # Create a graph of every (i.e. internal and external) dependencies in the
  378. # given file (report RP0402 must not be disabled)
  379. import-graph=
  380. # Create a graph of external dependencies in the given file (report RP0402 must
  381. # not be disabled)
  382. ext-import-graph=
  383. # Create a graph of internal dependencies in the given file (report RP0402 must
  384. # not be disabled)
  385. int-import-graph=
  386. [DESIGN]
  387. # Maximum number of arguments for function / method
  388. max-args=5
  389. # Argument names that match this expression will be ignored. Default to name
  390. # with leading underscore
  391. ignored-argument-names=_.*
  392. # Maximum number of locals for function / method body
  393. max-locals=15
  394. # Maximum number of return / yield for function / method body
  395. max-returns=6
  396. # Maximum number of branch for function / method body
  397. max-branches=12
  398. # Maximum number of statements in function / method body
  399. max-statements=50
  400. # Maximum number of parents for a class (see R0901).
  401. max-parents=7
  402. # Maximum number of attributes for a class (see R0902).
  403. max-attributes=7
  404. # Minimum number of public methods for a class (see R0903).
  405. min-public-methods=2
  406. # Maximum number of public methods for a class (see R0904).
  407. max-public-methods=20
  408. # Maximum number of boolean expressions in a if statement
  409. max-bool-expr=5
  410. [CLASSES]
  411. # List of method names used to declare (i.e. assign) instance attributes.
  412. defining-attr-methods=__init__,__new__,setUp
  413. # List of valid names for the first argument in a class method.
  414. valid-classmethod-first-arg=cls
  415. # List of valid names for the first argument in a metaclass class method.
  416. valid-metaclass-classmethod-first-arg=mcs
  417. # List of member names, which should be excluded from the protected access
  418. # warning.
  419. exclude-protected=_asdict,_fields,_replace,_source,_make
  420. [EXCEPTIONS]
  421. # Exceptions that will emit a warning when being caught. Defaults to
  422. # "Exception"
  423. overgeneral-exceptions=Exception