.pylintrc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. # This Pylint rcfile contains a best-effort configuration to uphold the
  2. # best-practices and style described in the Google Python style guide:
  3. # https://google.github.io/styleguide/pyguide.html
  4. #
  5. # Its canonical open-source location is:
  6. # https://google.github.io/styleguide/pylintrc
  7. [MASTER]
  8. # Files or directories to be skipped. They should be base names, not paths.
  9. ignore=docs
  10. # Files or directories matching the regex patterns are skipped. The regex
  11. # matches against base names, not paths.
  12. ignore-patterns=
  13. # Pickle collected data for later comparisons.
  14. persistent=no
  15. # List of plugins (as comma separated values of python modules names) to load,
  16. # usually to register additional checkers.
  17. load-plugins=
  18. # Use multiple processes to speed up Pylint.
  19. jobs=4
  20. # Allow loading of arbitrary C extensions. Extensions are imported into the
  21. # active Python interpreter and may run arbitrary code.
  22. unsafe-load-any-extension=no
  23. [MESSAGES CONTROL]
  24. # Only show warnings with the listed confidence levels. Leave empty to show
  25. # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
  26. confidence=
  27. # Enable the message, report, category or checker with the given id(s). You can
  28. # either give multiple identifier separated by comma (,) or put this option
  29. # multiple time (only on the command line, not in the configuration file where
  30. # it should appear only once). See also the "--disable" option for examples.
  31. #enable=
  32. # Disable the message, report, category or checker with the given id(s). You
  33. # can either give multiple identifiers separated by comma (,) or put this
  34. # option multiple times (only on the command line, not in the configuration
  35. # file where it should appear only once).You can also use "--disable=all" to
  36. # disable everything first and then reenable specific checks. For example, if
  37. # you want to run only the similarities checker, you can use "--disable=all
  38. # --enable=similarities". If you want to run only the classes checker, but have
  39. # no Warning level messages displayed, use"--disable=all --enable=classes
  40. # --disable=W"
  41. disable=abstract-method,
  42. apply-builtin,
  43. arguments-differ,
  44. attribute-defined-outside-init,
  45. backtick,
  46. bad-option-value,
  47. basestring-builtin,
  48. buffer-builtin,
  49. c-extension-no-member,
  50. consider-using-enumerate,
  51. cmp-builtin,
  52. cmp-method,
  53. coerce-builtin,
  54. coerce-method,
  55. delslice-method,
  56. div-method,
  57. duplicate-code,
  58. eq-without-hash,
  59. execfile-builtin,
  60. file-builtin,
  61. filter-builtin-not-iterating,
  62. fixme,
  63. getslice-method,
  64. global-statement,
  65. hex-method,
  66. idiv-method,
  67. implicit-str-concat-in-sequence,
  68. import-error,
  69. import-self,
  70. import-star-module-level,
  71. inconsistent-return-statements,
  72. input-builtin,
  73. intern-builtin,
  74. invalid-str-codec,
  75. invalid-name,
  76. locally-disabled,
  77. logging-fstring-interpolation,
  78. logging-not-lazy,
  79. long-builtin,
  80. long-suffix,
  81. map-builtin-not-iterating,
  82. misplaced-comparison-constant,
  83. missing-class-docstring,
  84. missing-function-docstring,
  85. missing-module-docstring,
  86. metaclass-assignment,
  87. next-method-called,
  88. next-method-defined,
  89. no-absolute-import,
  90. no-else-break,
  91. no-else-continue,
  92. no-else-raise,
  93. no-else-return,
  94. no-init,
  95. no-member,
  96. no-name-in-module,
  97. no-self-use,
  98. nonzero-method,
  99. oct-method,
  100. old-division,
  101. old-ne-operator,
  102. old-octal-literal,
  103. old-raise-syntax,
  104. parameter-unpacking,
  105. print-statement,
  106. raising-string,
  107. range-builtin-not-iterating,
  108. raw_input-builtin,
  109. rdiv-method,
  110. reduce-builtin,
  111. relative-import,
  112. reload-builtin,
  113. round-builtin,
  114. setslice-method,
  115. signature-differs,
  116. standarderror-builtin,
  117. suppressed-message,
  118. sys-max-int,
  119. too-few-public-methods,
  120. too-many-ancestors,
  121. too-many-arguments,
  122. too-many-boolean-expressions,
  123. too-many-branches,
  124. too-many-instance-attributes,
  125. too-many-locals,
  126. too-many-nested-blocks,
  127. too-many-public-methods,
  128. too-many-return-statements,
  129. too-many-statements,
  130. trailing-newlines,
  131. unichr-builtin,
  132. unicode-builtin,
  133. unnecessary-pass,
  134. unpacking-in-except,
  135. unspecified-encoding,
  136. useless-else-on-loop,
  137. useless-object-inheritance,
  138. useless-suppression,
  139. using-cmp-argument,
  140. wrong-import-order,
  141. xrange-builtin,
  142. zip-builtin-not-iterating,
  143. [REPORTS]
  144. # Set the output format. Available formats are text, parseable, colorized, msvs
  145. # (visual studio) and html. You can also give a reporter class, eg
  146. # mypackage.mymodule.MyReporterClass.
  147. output-format=text
  148. # Tells whether to display a full report or only the messages
  149. reports=no
  150. # Python expression which should return a note less than 10 (10 is the highest
  151. # note). You have access to the variables errors warning, statement which
  152. # respectively contain the number of errors / warnings messages and the total
  153. # number of statements analyzed. This is used by the global evaluation report
  154. # (RP0004).
  155. evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
  156. # Template used to display messages. This is a python new-style format string
  157. # used to format the message information. See doc for all details
  158. #msg-template=
  159. [BASIC]
  160. # Good variable names which should always be accepted, separated by a comma
  161. good-names=main,_
  162. # Bad variable names which should always be refused, separated by a comma
  163. bad-names=
  164. # Colon-delimited sets of names that determine each other's naming style when
  165. # the name regexes allow several styles.
  166. name-group=
  167. # Include a hint for the correct naming format with invalid-name
  168. include-naming-hint=no
  169. # List of decorators that produce properties, such as abc.abstractproperty. Add
  170. # to this list to register other decorators that produce valid properties.
  171. property-classes=abc.abstractproperty,cached_property.cached_property,cached_property.threaded_cached_property,cached_property.cached_property_with_ttl,cached_property.threaded_cached_property_with_ttl
  172. # Regular expression matching correct function names
  173. function-rgx=^(?:(?P<exempt>setUp|tearDown|setUpModule|tearDownModule)|(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$
  174. # Regular expression matching correct variable names
  175. variable-rgx=^[a-z][a-z0-9_]*$
  176. # Regular expression matching correct constant names
  177. const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
  178. # Regular expression matching correct attribute names
  179. attr-rgx=^_{0,2}[a-z][a-z0-9_]*$
  180. # Regular expression matching correct argument names
  181. argument-rgx=^[a-z][a-z0-9_]*$
  182. # Regular expression matching correct class attribute names
  183. class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
  184. # Regular expression matching correct inline iteration names
  185. inlinevar-rgx=^[a-z][a-z0-9_]*$
  186. # Regular expression matching correct class names
  187. class-rgx=^_?[A-Z][a-zA-Z0-9]*$
  188. # Regular expression matching correct module names
  189. module-rgx=^(_?[a-z][a-z0-9_]*|__init__)$
  190. # Regular expression matching correct method names
  191. method-rgx=(?x)^(?:(?P<exempt>_[a-z0-9_]+__|runTest|setUp|tearDown|setUpTestCase|tearDownTestCase|setupSelf|tearDownClass|setUpClass|(test|assert)_*[A-Z0-9][a-zA-Z0-9_]*|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9_]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$
  192. # Regular expression which should only match function or class names that do
  193. # not require a docstring.
  194. no-docstring-rgx=(__.*__|main|test.*|.*test|.*Test)$
  195. # Minimum line length for functions/classes that require docstrings, shorter
  196. # ones are exempt.
  197. docstring-min-length=10
  198. [TYPECHECK]
  199. # List of decorators that produce context managers, such as
  200. # contextlib.contextmanager. Add to this list to register other decorators that
  201. # produce valid context managers.
  202. contextmanager-decorators=contextlib.contextmanager,contextlib2.contextmanager
  203. # Tells whether missing members accessed in mixin class should be ignored. A
  204. # mixin class is detected if its name ends with "mixin" (case insensitive).
  205. ignore-mixin-members=yes
  206. # List of module names for which member attributes should not be checked
  207. # (useful for modules/projects where namespaces are manipulated during runtime
  208. # and thus existing member attributes cannot be deduced by static analysis. It
  209. # supports qualified module names, as well as Unix pattern matching.
  210. ignored-modules=
  211. # List of class names for which member attributes should not be checked (useful
  212. # for classes with dynamically set attributes). This supports the use of
  213. # qualified names.
  214. ignored-classes=optparse.Values,thread._local,_thread._local
  215. # List of members which are set dynamically and missed by pylint inference
  216. # system, and so shouldn't trigger E1101 when accessed. Python regular
  217. # expressions are accepted.
  218. generated-members=
  219. [FORMAT]
  220. # Maximum number of characters on a single line.
  221. max-line-length=80
  222. # TODO(https://github.com/PyCQA/pylint/issues/3352): Direct pylint to exempt
  223. # lines made too long by directives to pytype.
  224. # Regexp for a line that is allowed to be longer than the limit.
  225. ignore-long-lines=(?x)(
  226. ^\s*(\#\ )?<?https?://\S+>?$|
  227. ^\s*(from\s+\S+\s+)?import\s+.+$)
  228. # Allow the body of an if to be on the same line as the test if there is no
  229. # else.
  230. single-line-if-stmt=yes
  231. # Maximum number of lines in a module
  232. max-module-lines=99999
  233. # String used as indentation unit. The internal Google style guide mandates 2
  234. # spaces. Google's externaly-published style guide says 4, consistent with
  235. # PEP 8. Here, we use 2 spaces, for conformity with many open-sourced Google
  236. # projects (like TensorFlow).
  237. indent-string=' '
  238. # Number of spaces of indent required inside a hanging or continued line.
  239. indent-after-paren=4
  240. # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
  241. expected-line-ending-format=
  242. [MISCELLANEOUS]
  243. # List of note tags to take in consideration, separated by a comma.
  244. notes=TODO
  245. [STRING]
  246. # This flag controls whether inconsistent-quotes generates a warning when the
  247. # character used as a quote delimiter is used inconsistently within a module.
  248. check-quote-consistency=yes
  249. [VARIABLES]
  250. # Tells whether we should check for unused import in __init__ files.
  251. init-import=no
  252. # A regular expression matching the name of dummy variables (i.e. expectedly
  253. # not used).
  254. dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_)
  255. # List of additional names supposed to be defined in builtins. Remember that
  256. # you should avoid to define new builtins when possible.
  257. additional-builtins=
  258. # List of strings which can identify a callback function by name. A callback
  259. # name must start or end with one of those strings.
  260. callbacks=cb_,_cb
  261. # List of qualified module names which can have objects that can redefine
  262. # builtins.
  263. redefining-builtins-modules=six,six.moves,past.builtins,future.builtins,functools
  264. [LOGGING]
  265. # Logging modules to check that the string format arguments are in logging
  266. # function parameter format
  267. logging-modules=logging,absl.logging,tensorflow.io.logging
  268. [SIMILARITIES]
  269. # Minimum lines number of a similarity.
  270. min-similarity-lines=4
  271. # Ignore comments when computing similarities.
  272. ignore-comments=yes
  273. # Ignore docstrings when computing similarities.
  274. ignore-docstrings=yes
  275. # Ignore imports when computing similarities.
  276. ignore-imports=no
  277. [SPELLING]
  278. # Spelling dictionary name. Available dictionaries: none. To make it working
  279. # install python-enchant package.
  280. spelling-dict=
  281. # List of comma separated words that should not be checked.
  282. spelling-ignore-words=
  283. # A path to a file that contains private dictionary; one word per line.
  284. spelling-private-dict-file=
  285. # Tells whether to store unknown words to indicated private dictionary in
  286. # --spelling-private-dict-file option instead of raising a message.
  287. spelling-store-unknown-words=no
  288. [IMPORTS]
  289. # Deprecated modules which should not be used, separated by a comma
  290. deprecated-modules=regsub,
  291. TERMIOS,
  292. Bastion,
  293. rexec,
  294. sets
  295. # Create a graph of every (i.e. internal and external) dependencies in the
  296. # given file (report RP0402 must not be disabled)
  297. import-graph=
  298. # Create a graph of external dependencies in the given file (report RP0402 must
  299. # not be disabled)
  300. ext-import-graph=
  301. # Create a graph of internal dependencies in the given file (report RP0402 must
  302. # not be disabled)
  303. int-import-graph=
  304. # Force import order to recognize a module as part of the standard
  305. # compatibility libraries.
  306. known-standard-library=
  307. # Force import order to recognize a module as part of a third party library.
  308. known-third-party=enchant, absl
  309. # Analyse import fallback blocks. This can be used to support both Python 2 and
  310. # 3 compatible code, which means that the block might have code that exists
  311. # only in one or another interpreter, leading to false positives when analysed.
  312. analyse-fallback-blocks=no
  313. [CLASSES]
  314. # List of method names used to declare (i.e. assign) instance attributes.
  315. defining-attr-methods=__init__,
  316. __new__,
  317. setUp
  318. # List of member names, which should be excluded from the protected access
  319. # warning.
  320. exclude-protected=_asdict,
  321. _fields,
  322. _replace,
  323. _source,
  324. _make
  325. # List of valid names for the first argument in a class method.
  326. valid-classmethod-first-arg=cls,
  327. class_
  328. # List of valid names for the first argument in a metaclass class method.
  329. valid-metaclass-classmethod-first-arg=mcs
  330. [EXCEPTIONS]
  331. # Exceptions that will emit a warning when being caught. Defaults to
  332. # "Exception"
  333. overgeneral-exceptions=StandardError,
  334. Exception,
  335. BaseException