pylintrc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. # Copyright 2016 The Android Open Source Project
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. [MASTER]
  15. # Specify a configuration file.
  16. #rcfile=
  17. # Python code to execute, usually for sys.path manipulation such as
  18. # pygtk.require().
  19. #init-hook=
  20. # Profiled execution.
  21. profile=no
  22. # Add files or directories to the blacklist. They should be base names, not
  23. # paths.
  24. ignore=CVS,.svn,.git,update_metadata_pb2.py
  25. # Pickle collected data for later comparisons.
  26. persistent=yes
  27. # List of plugins (as comma separated values of python modules names) to load,
  28. # usually to register additional checkers.
  29. load-plugins=
  30. # Use multiple processes to speed up Pylint.
  31. jobs=1
  32. # Allow loading of arbitrary C extensions. Extensions are imported into the
  33. # active Python interpreter and may run arbitrary code.
  34. unsafe-load-any-extension=no
  35. # A comma-separated list of package or module names from where C extensions may
  36. # be loaded. Extensions are loading into the active Python interpreter and may
  37. # run arbitrary code
  38. extension-pkg-whitelist=
  39. # Allow optimization of some AST trees. This will activate a peephole AST
  40. # optimizer, which will apply various small optimizations. For instance, it can
  41. # be used to obtain the result of joining multiple strings with the addition
  42. # operator. Joining a lot of strings can lead to a maximum recursion error in
  43. # Pylint and this flag can prevent that. It has one side effect, the resulting
  44. # AST will be different than the one from reality.
  45. optimize-ast=no
  46. [MESSAGES CONTROL]
  47. # List of checkers and warnings to enable.
  48. enable=old-raise-syntax
  49. # Only show warnings with the listed confidence levels. Leave empty to show
  50. # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
  51. confidence=
  52. # Enable the message, report, category or checker with the given id(s). You can
  53. # either give multiple identifier separated by comma (,) or put this option
  54. # multiple time. See also the "--disable" option for examples.
  55. #enable=
  56. # Disable the message, report, category or checker with the given id(s). You
  57. # can either give multiple identifiers separated by comma (,) or put this
  58. # option multiple times (only on the command line, not in the configuration
  59. # file where it should appear only once).You can also use "--disable=all" to
  60. # disable everything first and then reenable specific checks. For example, if
  61. # you want to run only the similarities checker, you can use "--disable=all
  62. # --enable=similarities". If you want to run only the classes checker, but have
  63. # no Warning level messages displayed, use"--disable=all --enable=classes
  64. # --disable=W"
  65. # We leave many of the style warnings to judgement/peer review.
  66. disable=
  67. fixme,
  68. locally-disabled,
  69. locally-enabled,
  70. no-self-use,
  71. star-args,
  72. too-few-public-methods,
  73. too-many-arguments,
  74. too-many-branches,
  75. too-many-instance-attributes,
  76. too-many-lines,
  77. too-many-locals,
  78. too-many-public-methods,
  79. too-many-return-statements,
  80. too-many-statements,
  81. [REPORTS]
  82. # Set the output format. Available formats are text, parseable, colorized, msvs
  83. # (visual studio) and html. You can also give a reporter class, eg
  84. # mypackage.mymodule.MyReporterClass.
  85. output-format=text
  86. # Put messages in a separate file for each module / package specified on the
  87. # command line instead of printing them on stdout. Reports (if any) will be
  88. # written in a file name "pylint_global.[txt|html]".
  89. files-output=no
  90. # Tells whether to display a full report or only the messages
  91. reports=no
  92. # Python expression which should return a note less than 10 (10 is the highest
  93. # note). You have access to the variables errors warning, statement which
  94. # respectively contain the number of errors / warnings messages and the total
  95. # number of statements analyzed. This is used by the global evaluation report
  96. # (RP0004).
  97. #evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
  98. # Template used to display messages. This is a python new-style format string
  99. # used to format the message information. See doc for all details
  100. #msg-template=
  101. [SIMILARITIES]
  102. # Minimum lines number of a similarity.
  103. min-similarity-lines=20
  104. # Ignore comments when computing similarities.
  105. ignore-comments=yes
  106. # Ignore docstrings when computing similarities.
  107. ignore-docstrings=yes
  108. # Ignore imports when computing similarities.
  109. ignore-imports=no
  110. [TYPECHECK]
  111. # Tells whether missing members accessed in mixin class should be ignored. A
  112. # mixin class is detected if its name ends with "mixin" (case insensitive).
  113. ignore-mixin-members=yes
  114. # List of module names for which member attributes should not be checked
  115. # (useful for modules/projects where namespaces are manipulated during runtime
  116. # and thus existing member attributes cannot be deduced by static analysis. It
  117. # supports qualified module names, as well as Unix pattern matching.
  118. ignored-modules=update_payload.update_metadata_pb2
  119. # List of classes names for which member attributes should not be checked
  120. # (useful for classes with attributes dynamically set). This supports can work
  121. # with qualified names.
  122. ignored-classes=hashlib,numpy
  123. # List of members which are set dynamically and missed by pylint inference
  124. # system, and so shouldn't trigger E1101 when accessed. Python regular
  125. # expressions are accepted.
  126. generated-members=
  127. # List of decorators that create context managers from functions, such as
  128. # contextlib.contextmanager.
  129. contextmanager-decorators=contextlib.contextmanager,contextlib2.contextmanager
  130. [SPELLING]
  131. # Spelling dictionary name. Available dictionaries: none. To make it working
  132. # install python-enchant package.
  133. spelling-dict=
  134. # List of comma separated words that should not be checked.
  135. spelling-ignore-words=
  136. # A path to a file that contains private dictionary; one word per line.
  137. spelling-private-dict-file=
  138. # Tells whether to store unknown words to indicated private dictionary in
  139. # --spelling-private-dict-file option instead of raising a message.
  140. spelling-store-unknown-words=no
  141. [LOGGING]
  142. # Logging modules to check that the string format arguments are in logging
  143. # function parameter format
  144. logging-modules=logging
  145. [VARIABLES]
  146. # Tells whether we should check for unused import in __init__ files.
  147. init-import=no
  148. # A regular expression matching names used for dummy variables (i.e. not used).
  149. dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_)
  150. # List of additional names supposed to be defined in builtins. Remember that
  151. # you should avoid to define new builtins when possible.
  152. additional-builtins=
  153. # List of strings which can identify a callback function by name. A callback
  154. # name must start or end with one of those strings.
  155. callbacks=cb_,_cb
  156. [FORMAT]
  157. # Maximum number of characters on a single line.
  158. max-line-length=80
  159. # Allow the body of an if to be on the same line as the test if there is no
  160. # else.
  161. single-line-if-stmt=no
  162. # Regexp for a line that is allowed to be longer than the limit.
  163. # This "ignore" regex is today composed of 4 independent parts:
  164. # (1) Long import lines
  165. # (2) URLs in comments or pydocs. Detecting URLs by regex is a hard problem and
  166. # no amount of tweaking will make a perfect regex AFAICT. This one is a good
  167. # compromise.
  168. # (3) Constant string literals at the start of files don't need to be broken
  169. # across lines. Allowing long paths, streamz and urls to be on a single
  170. # line. Also requires that the string not be a triplequoted string.
  171. ignore-long-lines=(?x)
  172. (^\s*(import|from)\s
  173. |^\s*(\#\ )?<?(https?|ftp):\/\/[^\s\/$.?#].[^\s]*>?$
  174. |^[a-zA-Z_][a-zA-Z0-9_]*\s*=\s*("[^"]\S+"|'[^']\S+')
  175. )
  176. # Maximum number of lines in a module
  177. max-module-lines=99999
  178. # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
  179. # tab).
  180. indent-string=' '
  181. # Number of spaces of indent required inside a hanging or continued line.
  182. indent-after-paren=4
  183. # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
  184. expected-line-ending-format=LF
  185. # Make sure : in dicts and trailing commas are checked for whitespace.
  186. no-space-check=
  187. [MISCELLANEOUS]
  188. # List of note tags to take in consideration, separated by a comma.
  189. notes=FIXME,XXX,TODO
  190. [BASIC]
  191. # Required attributes for module, separated by a comma
  192. required-attributes=
  193. # List of builtins function names that should not be used, separated by a comma
  194. bad-functions=map,filter,input,apply,reduce
  195. # Good variable names which should always be accepted, separated by a comma
  196. good-names=i,j,k,ex,x,_,main
  197. # Bad variable names which should always be refused, separated by a comma
  198. bad-names=foo,bar,baz,toto,tutu,tata
  199. # Colon-delimited sets of names that determine each other's naming style when
  200. # the name regexes allow several styles.
  201. name-group=
  202. # Include a hint for the correct naming format with invalid-name
  203. include-naming-hint=no
  204. # Regular expression which should only match correct function names.
  205. # 'camel_case' and 'snake_case' group names are used for consistency of naming
  206. # styles across functions and methods.
  207. function-rgx=^(?:(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$
  208. # Naming hint for function names
  209. function-name-hint=[a-z_][a-z0-9_]{2,30}$
  210. # Regular expression which should only match correct variable names
  211. variable-rgx=^[a-z][a-z0-9_]*$
  212. # Naming hint for variable names
  213. variable-name-hint=[a-z_][a-z0-9_]{2,30}$
  214. # Regular expression which should only match correct module level names
  215. const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
  216. # Naming hint for constant names
  217. const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
  218. # Regular expression which should only match correct instance attribute names
  219. attr-rgx=^_{0,2}[a-z][a-z0-9_]*$
  220. # Naming hint for attribute names
  221. attr-name-hint=[a-z_][a-z0-9_]{2,30}$
  222. # Regular expression which should only match correct argument names
  223. argument-rgx=^[a-z][a-z0-9_]*$
  224. # Naming hint for argument names
  225. argument-name-hint=[a-z_][a-z0-9_]{2,30}$
  226. # Regular expression which should only match correct class attribute
  227. class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
  228. # Naming hint for class attribute names
  229. class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
  230. # Regular expression which should only match correct list comprehension /
  231. # generator expression variable names
  232. inlinevar-rgx=^[a-z][a-z0-9_]*$
  233. # Naming hint for inline iteration names
  234. inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
  235. # Regular expression which should only match correct class names
  236. class-rgx=^_?[A-Z][a-zA-Z0-9]*$
  237. # Naming hint for class names
  238. class-name-hint=[A-Z_][a-zA-Z0-9]+$
  239. # Regular expression which should only match correct module names. The
  240. # leading underscore is sanctioned for private modules by Google's style
  241. # guide.
  242. module-rgx=^(_?[a-z][a-z0-9_]*)|__init__$
  243. # Naming hint for module names
  244. module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  245. # Regular expression which should only match correct method names.
  246. # 'camel_case' and 'snake_case' group names are used for consistency of naming
  247. # styles across functions and methods. 'exempt' indicates a name which is
  248. # consistent with all naming styles.
  249. method-rgx=^(?:(?P<exempt>__[a-z0-9_]+__|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$
  250. # Naming hint for method names
  251. method-name-hint=[a-z_][a-z0-9_]{2,30}$
  252. # Regular expression which should only match function or class names that do
  253. # not require a docstring.
  254. no-docstring-rgx=(__.*__|main)
  255. # Minimum line length for functions/classes that require docstrings, shorter
  256. # ones are exempt.
  257. docstring-min-length=10
  258. # List of decorators that define properties, such as abc.abstractproperty.
  259. property-classes=abc.abstractproperty
  260. [ELIF]
  261. # Maximum number of nested blocks for function / method body
  262. max-nested-blocks=5
  263. [DESIGN]
  264. # Maximum number of arguments for function / method
  265. max-args=5
  266. # Argument names that match this expression will be ignored. Default to name
  267. # with leading underscore
  268. ignored-argument-names=_.*
  269. # Maximum number of locals for function / method body
  270. max-locals=15
  271. # Maximum number of return / yield for function / method body
  272. max-returns=6
  273. # Maximum number of branch for function / method body
  274. max-branches=12
  275. # Maximum number of statements in function / method body
  276. max-statements=50
  277. # Maximum number of parents for a class (see R0901).
  278. max-parents=10
  279. # Maximum number of attributes for a class (see R0902).
  280. max-attributes=7
  281. # Minimum number of public methods for a class (see R0903).
  282. min-public-methods=2
  283. # Maximum number of public methods for a class (see R0904).
  284. max-public-methods=20
  285. # Maximum number of boolean expressions in a if statement
  286. max-bool-expr=5
  287. [CLASSES]
  288. # List of method names used to declare (i.e. assign) instance attributes.
  289. defining-attr-methods=__init__,__new__,setUp
  290. # List of valid names for the first argument in a class method.
  291. valid-classmethod-first-arg=cls
  292. # List of valid names for the first argument in a metaclass class method.
  293. valid-metaclass-classmethod-first-arg=mcs
  294. # List of member names, which should be excluded from the protected access
  295. # warning.
  296. exclude-protected=_asdict,_fields,_replace,_source,_make
  297. [IMPORTS]
  298. # Deprecated modules which should not be used, separated by a comma
  299. deprecated-modules=regsub,TERMIOS,Bastion,rexec,optparse
  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. [EXCEPTIONS]
  310. # Exceptions that will emit a warning when being caught. Defaults to
  311. # "Exception"
  312. overgeneral-exceptions=StandardError,Exception,BaseException