.pylintrc 13 KB

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