websyhg 发表于 2018-1-7 08:42:39

pylint & jenkins

Usage:pylint module_or_package  

  Check that a module satisfies a coding standard (and more !).
  

  pylint --help
  

  Display this help message and exit.
  

  pylint --help-msg <msg-id>[,<msg-id>]
  


  Display help messages about given message>  

  

  
Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  显示所有帮助信息。
  --long-help         more verbose help.
  

  Master:
  --rcfile=<file>   Specify a configuration file.
  指定一个配置文件。把使用的配置放在配置文件中,这样不仅规范了自己代码,也可以方便地和别人共享这些规范。
  --init-hook=<code>Python code to execute, usually for sys.path manipulation such as pygtk.require().
  -E, --errors-only   In error mode, checkers without error messages are
  disabled and for others, only the ERROR messages are
  displayed, and no reports are done by default
  --py3k            In Python 3 porting mode, all checkers will be
  disabled and only messages emitted by the porting
  checker will be displayed
  --ignore=<file>[,<file>...]
  Add files or directories to the blacklist. They should
  be base names, not paths.
  --ignore-patterns=<pattern>[,<pattern>...]
  Add files or directories matching the regex patterns
  to the blacklist. The regex matches against base
  names, not paths.
  --persistent=<y_or_n>
  Pickle collected data for later comparisons. [current:
  yes]
  --load-plugins=<modules>
  List of plugins (as comma separated values of python
  modules names) to load, usually to register additional
  checkers.
  -j <n-processes>, --jobs=<n-processes>
  Use multiple processes to speed up Pylint. [current:
  1]
  --extension-pkg-whitelist=<pkg[,pkg]>
  A comma-separated list of package or module names from
  where C extensions may be loaded. Extensions are
  loading into the active Python interpreter and may run
  arbitrary code
  --optimize-ast=<yn>
  Allow optimization of some AST trees. This will
  activate a peephole AST optimizer, which will apply
  various small optimizations. For instance, it can be
  used to obtain the result of joining multiple strings
  with the addition operator. Joining a lot of strings
  can lead to a maximum recursion error in Pylint and
  this flag can prevent that. It has one side effect,
  the resulting AST will be different than the one from
  reality. This option is deprecated and it will be
  removed in Pylint 2.0.
  

  Commands:
  --help-msg=<msg-id>

  Display a help message for the given message>  exit. The value may be a comma separated list of

  message>  --list-msgs         Generate pylint's messages.
  --list-conf-levelsGenerate pylint's messages.
  --full-documentation
  Generate pylint's full documentation.
  --generate-rcfile   Generate a sample configuration file according to the
  current configuration. You can put other options
  before this one to get them in the generated
  configuration.
  可以使用 pylint --generate-rcfile 来生成一个配置文件示例。可以使用重定向把这个配置文件保存下来用做以后使用。也可以在前面加上其它选项,使这些选项的值被包含在这个产生的配置文件里。如:pylint --persistent=n --generate-rcfile > pylint.conf,查看 pylint.conf,可以看到 persistent=no,而不再是其默认值 yes。
  

  Messages control:
  --confidence=<levels>
  Only show warnings with the listed confidence levels.
  Leave empty to show all. Valid levels: HIGH,
  INFERENCE, INFERENCE_FAILURE, UNDEFINED [current:
  none]

  -e <msg>  Enable the message, report, category or checker with

  the given>  identifier separated by comma (,) or put this option
  multiple time (only on the command line, not in the
  configuration file where it should appear only once).
  See also the "--disable" option for examples.

  -d <msg>  Disable the message, report, category or checker with

  the given>  identifiers separated by comma (,) or put this option
  multiple times (only on the command line, not in the
  configuration file where it should appear only
  once).You can also use "--disable=all" to disable
  everything first and then reenable specific checks.
  For example, if you want to run only the similarities
  checker, you can use "--disable=all
  --enable=similarities". If you want to run only the
  classes checker, but have no Warning level messages
  displayed, use"--disable=all --enable=classes
  --disable=W"
  禁止指定>--disable-msg= W0402
  

  Reports:
  -f <format>, --output-format=<format>

  Set the output format. Available formats are text, parseable, colorized, msvs (visual studio) and html. You can also give a reporter>  设置输出格式。可以选择的格式有 text, parseable, colorized, msvs (visual studio) 和 html, 默认的输出格式是 text。
  --files-output=<y_or_n>
  Put messages in a separate file for each module / package specified on the command line instead of printing them on stdout. Reports (if any) will be written in a file name "pylint_global.".
  This option is deprecated and it will be removed in Pylint 2.0.
  将每个 module /package 的 message 输出到一个以 pylint_module/package. 命名的文件中,如果有 report 的话,输出到名为 pylint_global. 的文件中。默认是输出到屏幕上不输出到文件里。
  -r <y_or_n>, --reports=<y_or_n>
  Tells whether to display a full report or only the messages
  默认是 y, 表示 Pylint 的输出中除了包含源代码分析部分,也包含报告部分。
  --evaluation=<python_expression>
  Python expression which should return a note less than
  10 (10 is the highest note). You have access to the
  variables errors warning, statement which respectively
  contain the number of errors / warnings messages and
  the total number of statements analyzed. This is used
  by the global evaluation report (RP0004). [current:
  10.0 - ((float(5 * error + warning + refactor +
  convention) / statement) * 10)]
  --msg-template=<template>
  Template used to display messages. This is a python
  new-style format string used to format the message
  information. See doc for all details
  
页: [1]
查看完整版本: pylint & jenkins