.pylintrc 14 KB

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