.pylintrc 14 KB

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