1
0

.pylintrc 14 KB

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