.pylintrc 14 KB

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