.pylintrc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. # -*- coding: utf-8; mode: conf -*-
  2. # lint Python modules using external checkers.
  3. #
  4. # This is the main checker controlling the other ones and the reports
  5. # generation. It is itself both a raw checker and an astng checker in order
  6. # to:
  7. # * handle message activation / deactivation at the module level
  8. # * handle some basic but necessary stats'data (number of classes, methods...)
  9. #
  10. [MASTER]
  11. # A comma-separated list of package or module names from where C extensions may
  12. # be loaded. Extensions are loading into the active Python interpreter and may
  13. # run arbitrary code
  14. extension-pkg-whitelist=lxml.etree
  15. # Add files or directories to the blacklist. They should be base names, not
  16. # paths.
  17. ignore=CVS, .git, .svn
  18. # Add files or directories matching the regex patterns to the blacklist. The
  19. # regex matches against base names, not paths.
  20. ignore-patterns=
  21. # Python code to execute, usually for sys.path manipulation such as
  22. # pygtk.require().
  23. #init-hook=
  24. # Use multiple processes to speed up Pylint.
  25. jobs=1
  26. # List of plugins (as comma separated values of python modules names) to load,
  27. # usually to register additional checkers.
  28. load-plugins=
  29. # Pickle collected data for later comparisons.
  30. persistent=yes
  31. # Specify a configuration file.
  32. #rcfile=
  33. # Allow loading of arbitrary C extensions. Extensions are imported into the
  34. # active Python interpreter and may run arbitrary code.
  35. unsafe-load-any-extension=no
  36. [MESSAGES CONTROL]
  37. # Only show warnings with the listed confidence levels. Leave empty to show
  38. # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
  39. confidence=
  40. # Disable the message, report, category or checker with the given id(s). You
  41. # can either give multiple identifiers separated by comma (,) or put this
  42. # option multiple times (only on the command line, not in the configuration
  43. # file where it should appear only once).You can also use "--disable=all" to
  44. # disable everything first and then reenable specific checks. For example, if
  45. # you want to run only the similarities checker, you can use "--disable=all
  46. # --enable=similarities". If you want to run only the classes checker, but have
  47. # no Warning level messages displayed, use"--disable=all --enable=classes
  48. # --disable=W"
  49. disable=bad-whitespace,
  50. duplicate-code,
  51. missing-function-docstring,
  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 (only on the command line, not in the configuration file where
  55. # it should appear only once). See also the "--disable" option for examples.
  56. enable=
  57. [REPORTS]
  58. # Python expression which should return a note less than 10 (10 is the highest
  59. # note). You have access to the variables errors warning, statement which
  60. # respectively contain the number of errors / warnings messages and the total
  61. # number of statements analyzed. This is used by the global evaluation report
  62. # (RP0004).
  63. evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
  64. # Template used to display messages. This is a python new-style format string
  65. # used to format the message information. See doc for all details
  66. # HINT: do not set this here, use argument --msg-template=...
  67. #msg-template={path}:{line}: [{msg_id}({symbol}),{obj}] {msg}
  68. # Set the output format. Available formats are text, parseable, colorized, json
  69. # and msvs (visual studio).You can also give a reporter class, eg
  70. # mypackage.mymodule.MyReporterClass.
  71. # HINT: do not set this here, use argument --output-format=...
  72. #output-format=text
  73. # Tells whether to display a full report or only the messages
  74. reports=no
  75. # Activate the evaluation score.
  76. score=yes
  77. [REFACTORING]
  78. # Maximum number of nested blocks for function / method body
  79. max-nested-blocks=5
  80. [BASIC]
  81. # List of builtins function names that should not be used, separated by a comma
  82. bad-functions=map,filter,apply,input
  83. # Naming hint for argument names
  84. argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
  85. # Regular expression matching correct argument names
  86. argument-rgx=(([a-z][a-zA-Z0-9_]{2,30})|(_[a-z0-9_]*))$
  87. # Naming hint for attribute names
  88. attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
  89. # Regular expression matching correct attribute names
  90. attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*)|([A-Z0-9_]*))$
  91. # Bad variable names which should always be refused, separated by a comma
  92. bad-names=foo,bar,baz,toto,tutu,tata
  93. # Naming hint for class attribute names
  94. class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
  95. # Regular expression matching correct class attribute names
  96. class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
  97. # Naming hint for class names
  98. class-name-hint=[A-Z_][a-zA-Z0-9]+$
  99. # Regular expression matching correct class names
  100. class-rgx=[A-Z_][a-zA-Z0-9]+$
  101. # Naming hint for constant names
  102. const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
  103. # Regular expression matching correct constant names
  104. const-rgx=(([a-zA-Z_][a-zA-Z0-9_]*)|(__.*__))$
  105. #const-rgx=[f]?[A-Z_][a-zA-Z0-9_]{2,30}$
  106. # Minimum line length for functions/classes that require docstrings, shorter
  107. # ones are exempt.
  108. docstring-min-length=-1
  109. # Naming hint for function names
  110. function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
  111. # Regular expression matching correct function names
  112. function-rgx=(([a-z][a-zA-Z0-9_]{2,30})|(_[a-z0-9_]*))$
  113. # Good variable names which should always be accepted, separated by a comma
  114. good-names=i,j,k,ex,Run,_,log,cfg,id
  115. # Include a hint for the correct naming format with invalid-name
  116. include-naming-hint=no
  117. # Naming hint for inline iteration names
  118. inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
  119. # Regular expression matching correct inline iteration names
  120. inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
  121. # Naming hint for method names
  122. method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
  123. # Regular expression matching correct method names
  124. method-rgx=(([a-z][a-zA-Z0-9_]{2,30})|(_[a-z0-9_]*))$
  125. # Naming hint for module names
  126. module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  127. # Regular expression matching correct module names
  128. #module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
  129. module-rgx=([a-z_][a-z0-9_]*)$
  130. # Colon-delimited sets of names that determine each other's naming style when
  131. # the name regexes allow several styles.
  132. name-group=
  133. # Regular expression which should only match function or class names that do
  134. # not require a docstring.
  135. no-docstring-rgx=^_
  136. # List of decorators that produce properties, such as abc.abstractproperty. Add
  137. # to this list to register other decorators that produce valid properties.
  138. property-classes=abc.abstractproperty
  139. # Naming hint for variable names
  140. variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
  141. # Regular expression matching correct variable names
  142. variable-rgx=(([a-z][a-zA-Z0-9_]{2,30})|(_[a-z0-9_]*)|([a-z]))$
  143. [FORMAT]
  144. # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
  145. expected-line-ending-format=
  146. # Regexp for a line that is allowed to be longer than the limit.
  147. ignore-long-lines=^\s*(# )?<?https?://\S+>?$
  148. # Number of spaces of indent required inside a hanging or continued line.
  149. indent-after-paren=4
  150. # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
  151. # tab).
  152. indent-string=' '
  153. # Maximum number of characters on a single line.
  154. max-line-length=120
  155. # Maximum number of lines in a module
  156. max-module-lines=2000
  157. # List of optional constructs for which whitespace checking is disabled. `dict-
  158. # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
  159. # `trailing-comma` allows a space between comma and closing bracket: (a, ).
  160. # `empty-line` allows space-only lines.
  161. no-space-check=trailing-comma,dict-separator
  162. # Allow the body of a class to be on the same line as the declaration if body
  163. # contains single statement.No config file found, using default configuration
  164. single-line-class-stmt=no
  165. # Allow the body of an if to be on the same line as the test if there is no
  166. # else.
  167. single-line-if-stmt=no
  168. [LOGGING]
  169. # Logging modules to check that the string format arguments are in logging
  170. # function parameter format
  171. logging-modules=logging
  172. [MISCELLANEOUS]
  173. # List of note tags to take in consideration, separated by a comma.
  174. notes=FIXME,XXX,TODO
  175. [SIMILARITIES]
  176. # Ignore comments when computing similarities.
  177. ignore-comments=yes
  178. # Ignore docstrings when computing similarities.
  179. ignore-docstrings=yes
  180. # Ignore imports when computing similarities.
  181. ignore-imports=no
  182. # Minimum lines number of a similarity.
  183. min-similarity-lines=4
  184. [SPELLING]
  185. # Spelling dictionary name. Available dictionaries: none. To make it working
  186. # install python-enchant package.
  187. spelling-dict=
  188. # List of comma separated words that should not be checked.
  189. spelling-ignore-words=
  190. # A path to a file that contains private dictionary; one word per line.
  191. spelling-private-dict-file=
  192. # Tells whether to store unknown words to indicated private dictionary in
  193. # --spelling-private-dict-file option instead of raising a message.
  194. spelling-store-unknown-words=no
  195. [TYPECHECK]
  196. # List of decorators that produce context managers, such as
  197. # contextlib.contextmanager. Add to this list to register other decorators that
  198. # produce valid context managers.
  199. contextmanager-decorators=contextlib.contextmanager
  200. # List of members which are set dynamically and missed by pylint inference
  201. # system, and so shouldn't trigger E1101 when accessed. Python regular
  202. # expressions are accepted.
  203. generated-members=
  204. # Tells whether missing members accessed in mixin class should be ignored. A
  205. # mixin class is detected if its name ends with "mixin" (case insensitive).
  206. ignore-mixin-members=yes
  207. # This flag controls whether pylint should warn about no-member and similar
  208. # checks whenever an opaque object is returned when inferring. The inference
  209. # can return multiple potential results while evaluating a Python object, but
  210. # some branches might not be evaluated, which results in partial inference. In
  211. # that case, it might be useful to still emit no-member and other checks for
  212. # the rest of the inferred objects.
  213. ignore-on-opaque-inference=yes
  214. # List of class names for which member attributes should not be checked (useful
  215. # for classes with dynamically set attributes). This supports the use of
  216. # qualified names.
  217. ignored-classes=optparse.Values,thread._local,_thread._local
  218. # List of module names for which member attributes should not be checked
  219. # (useful for modules/projects where namespaces are manipulated during runtime
  220. # and thus existing member attributes cannot be deduced by static analysis. It
  221. # supports qualified module names, as well as Unix pattern matching.
  222. ignored-modules=
  223. # Show a hint with possible names when a member name was not found. The aspect
  224. # of finding the hint is based on edit distance.
  225. missing-member-hint=yes
  226. # The minimum edit distance a name should have in order to be considered a
  227. # similar match for a missing member name.
  228. missing-member-hint-distance=1
  229. # The total number of similar names that should be taken in consideration when
  230. # showing a hint for a missing member.
  231. missing-member-max-choices=1
  232. [VARIABLES]
  233. # List of additional names supposed to be defined in builtins. Remember that
  234. # you should avoid to define new builtins when possible.
  235. additional-builtins=
  236. # Tells whether unused global variables should be treated as a violation.
  237. allow-global-unused-variables=yes
  238. # List of strings which can identify a callback function by name. A callback
  239. # name must start or end with one of those strings.
  240. callbacks=cb_,_cb
  241. # A regular expression matching the name of dummy variables (i.e. expectedly
  242. # not used).
  243. dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
  244. # Argument names that match this expression will be ignored. Default to name
  245. # with leading underscore
  246. ignored-argument-names=_.*|^ignored_|^unused_
  247. # Tells whether we should check for unused import in __init__ files.
  248. init-import=no
  249. # List of qualified module names which can have objects that can redefine
  250. # builtins.
  251. redefining-builtins-modules=six.moves,future.builtins
  252. [CLASSES]
  253. # List of method names used to declare (i.e. assign) instance attributes.
  254. defining-attr-methods=__init__,__new__,setUp
  255. # List of member names, which should be excluded from the protected access
  256. # warning.
  257. exclude-protected=_asdict,_fields,_replace,_source,_make
  258. # List of valid names for the first argument in a class method.
  259. valid-classmethod-first-arg=cls
  260. # List of valid names for the first argument in a metaclass class method.
  261. valid-metaclass-classmethod-first-arg=mcs
  262. [DESIGN]
  263. # Maximum number of arguments for function / method
  264. max-args=8
  265. # Maximum number of attributes for a class (see R0902).
  266. max-attributes=20
  267. # Maximum number of boolean expressions in a if statement
  268. max-bool-expr=5
  269. # Maximum number of branch for function / method body
  270. max-branches=12
  271. # Maximum number of locals for function / method body
  272. max-locals=20
  273. # Maximum number of parents for a class (see R0901).
  274. max-parents=7
  275. # Maximum number of public methods for a class (see R0904).
  276. max-public-methods=20
  277. # Maximum number of return / yield for function / method body
  278. max-returns=6
  279. # Maximum number of statements in function / method body
  280. max-statements=50
  281. # Minimum number of public methods for a class (see R0903).
  282. min-public-methods=2
  283. [IMPORTS]
  284. # Allow wildcard imports from modules that define __all__.
  285. allow-wildcard-with-all=no
  286. # Analyse import fallback blocks. This can be used to support both Python 2 and
  287. # 3 compatible code, which means that the block might have code that exists
  288. # only in one or another interpreter, leading to false positives when analysed.
  289. analyse-fallback-blocks=no
  290. # Deprecated modules which should not be used, separated by a comma
  291. deprecated-modules=optparse,tkinter.tix
  292. # Create a graph of external dependencies in the given file (report RP0402 must
  293. # not be disabled)
  294. ext-import-graph=
  295. # Create a graph of every (i.e. internal and external) dependencies in the
  296. # given file (report RP0402 must not be disabled)
  297. import-graph=
  298. # Create a graph of internal dependencies in the given file (report RP0402 must
  299. # not be disabled)
  300. int-import-graph=
  301. # Force import order to recognize a module as part of the standard
  302. # compatibility libraries.
  303. known-standard-library=
  304. # Force import order to recognize a module as part of a third party library.
  305. known-third-party=enchant
  306. [EXCEPTIONS]
  307. # Exceptions that will emit a warning when being caught. Defaults to
  308. # "Exception"
  309. overgeneral-exceptions=Exception