Optional Pylint checkers in the extensions module¶
Pylint provides the following optional plugins:
- Deprecated Builtins checker
- Else If Used checker
- Compare-To-Zero checker
- Parameter Documentation checker
- Docstyle checker
- Compare-To-Empty-String checker
- Design checker
- Overlap-Except checker
- Multiple Types checker
You can activate any or all of these extensions by adding a load-plugins line to the MASTER section of your .pylintrc, for example:
load-plugins=pylint.extensions.docparams,pylint.extensions.docstyle
Deprecated Builtins checker¶
This checker is provided by pylint.extensions.bad_builtin.
Verbatim name of the checker is deprecated_builtins.
Options¶
| bad-functions: | List of builtins function names that should not be used, separated by a comma Default: |
|---|
Messages¶
| bad-builtin (W0141): | |
|---|---|
| Used builtin function %s Used when a black listed builtin function is used (see the bad-function option). Usual black listed functions are the ones like map, or filter , where Python offers now some cleaner alternative like list comprehension. | |
Else If Used checker¶
This checker is provided by pylint.extensions.check_elif.
Verbatim name of the checker is else_if_used.
Messages¶
| else-if-used (R5501): | |
|---|---|
| Consider using “elif” instead of “else if” Used when an else statement is immediately followed by an if statement and does not contain statements that would be unrelated to it. | |
Compare-To-Zero checker¶
This checker is provided by pylint.extensions.comparetozero.
Verbatim name of the checker is compare-to-zero.
Messages¶
| compare-to-zero (C2001): | |
|---|---|
| Avoid comparisons to zero Used when Pylint detects comparison to a 0 constant. | |
Parameter Documentation checker¶
This checker is provided by pylint.extensions.docparams.
Verbatim name of the checker is parameter_documentation.
Options¶
| accept-no-param-doc: | |
|---|---|
Whether to accept totally missing parameter documentation in the docstring of a function that has parameters. Default: |
|
| accept-no-raise-doc: | |
Whether to accept totally missing raises documentation in the docstring of a function that raises an exception. Default: |
|
| accept-no-return-doc: | |
Whether to accept totally missing return documentation in the docstring of a function that returns a statement. Default: |
|
| accept-no-yields-doc: | |
Whether to accept totally missing yields documentation in the docstring of a generator. Default: |
|
Messages¶
| differing-param-doc (W9017): | |
|---|---|
| “%s” differing in parameter documentation Please check parameter names in declarations. | |
| differing-type-doc (W9018): | |
| “%s” differing in parameter type documentation Please check parameter names in type declarations. | |
| multiple-constructor-doc (W9005): | |
| “%s” has constructor parameters documented in class and __init__ Please remove parameter declarations in the class or constructor. | |
| missing-param-doc (W9015): | |
| “%s” missing in parameter documentation Please add parameter declarations for all parameters. | |
| missing-type-doc (W9016): | |
| “%s” missing in parameter type documentation Please add parameter type declarations for all parameters. | |
| missing-raises-doc (W9006): | |
| “%s” not documented as being raised Please document exceptions for all raised exception types. | |
| missing-return-doc (W9011): | |
| Missing return documentation Please add documentation about what this method returns. | |
| missing-return-type-doc (W9012): | |
| Missing return type documentation Please document the type returned by this method. | |
| missing-yield-doc (W9013): | |
| Missing yield documentation Please add documentation about what this generator yields. | |
| missing-yield-type-doc (W9014): | |
| Missing yield type documentation Please document the type yielded by this method. | |
| redundant-returns-doc (W9008): | |
| Redundant returns documentation Please remove the return/rtype documentation from this method. | |
| redundant-yields-doc (W9010): | |
| Redundant yields documentation Please remove the yields documentation from this method. | |
Docstyle checker¶
This checker is provided by pylint.extensions.docstyle.
Verbatim name of the checker is docstyle.
Messages¶
| bad-docstring-quotes (C0198): | |
|---|---|
| Bad docstring quotes in %s, expected “”“, given %s Used when a docstring does not have triple double quotes. | |
| docstring-first-line-empty (C0199): | |
| First line empty in %s docstring Used when a blank line is found at the beginning of a docstring. | |
Compare-To-Empty-String checker¶
This checker is provided by pylint.extensions.emptystring.
Verbatim name of the checker is compare-to-empty-string.
Messages¶
| compare-to-empty-string (C1901): | |
|---|---|
| Avoid comparisons to empty string Used when Pylint detects comparison to an empty string constant. | |
Design checker¶
This checker is provided by pylint.extensions.mccabe.
Verbatim name of the checker is design.
Options¶
| max-complexity: | McCabe complexity cyclomatic threshold Default: |
|---|
Messages¶
| too-complex (R1260): | |
|---|---|
| %s is too complex. The McCabe rating is %d Used when a method or function is too complex based on McCabe Complexity Cyclomatic | |