Diviner

Class ArcanistPyLintLinter

Definedsrc/lint/linter/ArcanistPyLintLinter.php:54
GroupLinters
ExtendsArcanistLinter

Uses "PyLint" to detect various errors in Python code. To use this linter, you must install pylint and configure which codes you want to be reported as errors, warnings and advice.

You should be able to install pylint with sudo easy_install pylint. If your system is unusual, you can manually specify the location of pylint and its dependencies by configuring these keys in your .arcconfig:

lint.pylint.prefix
lint.pylint.logilab_astng.prefix
lint.pylint.logilab_common.prefix

You can specify additional command-line options to pass to PyLint by setting lint.pylint.options. You may also specify a list of additional entries for PYTHONPATH with lint.pylint.pythonpath. Those can be absolute or relative to the project root.

If you have a PyLint rcfile, specify its path with lint.pylint.rcfile. It can be absolute or relative to the project root. Be sure not to define output-format, or if you do, set it to text.

Specify which PyLint messages map to which Arcanist messages by defining the following regular expressions:

lint.pylint.codes.error
lint.pylint.codes.warning
lint.pylint.codes.advice

The regexps are run in that order; the first to match determines which Arcanist severity applies, if any. For example, to capture all PyLint "E...." errors as Arcanist errors, set lint.pylint.codes.error to:

^E.*

You can also match more granularly:

^E(0001|0002)$

According to man pylint, there are 5 kind of messages:

(C) convention, for programming standard violation
(R) refactor, for bad code smell
(W) warning, for python specific problems
(E) error, for probable bugs in the code
(F) fatal, if an error occurred which prevented pylint from
    doing further processing.

Tasks

Methods

public getLintNameMap()

returnwild
This method is not documented.

public getLintSeverityMap()

returnwild
This method is not documented.

public getLinterName()

returnwild
This method is not documented.

private getMessageCodeSeverity($code)

parameterswild$code
returnwild
This method is not documented.

private getPyLintOptions()

returnwild
This method is not documented.

private getPyLintPath()

returnwild
This method is not documented.

private getPyLintPythonPath()

returnwild
This method is not documented.

public lintPath($path)

parameterswild$path
returnwild
This method is not documented.

public willLintPaths(array $paths)

parametersarray$paths
returnwild
This method is not documented.