.pylintrc 13 KB

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