A list of pylint-errors with reasoning and examples of erroneous and correct code.
Project description
A list of pylint-errors with reasoning and examples of erroneous and correct code.
Table of contents
CLI usage
It's not required to install CLI util as long as you can navigate list of errors here or on this web-site but you may want to do so.
Stable release
You can install a stable release simply by such commands:
$ python3 -m pip install plerr
$ plerr r1710
For pipx:
$ python3 -m pip install pipx # if not yet installed pipx
$ python3 -m pipx ensurepath # ensure directory where pipx stores apps is on PATH
$ pipx install plerr
$ plerr r1710
Dev builds
In order to use development plerr
builds you need to invoke the following commands:
$ git clone https://github.com/britonad/pylint-errors.git
$ sudo apt update && sudo apt install -y python3-pip # if not yet installed
$ cd pylint-errors
$ python3 setup.py test
$ python3 setup.py install --user
$ python3 -m plerr r1710
pipx users may install the library by such commands:
$ git clone https://github.com/britonad/pylint-errors.git
$ sudo apt install -y make python3-pip python3-venv # if not yet installed
$ cd pylint-errors
$ python3 -m pip install pipx wheel # install a package to build a wheel and pipx
$ python3 -m pipx ensurepath # ensure directory where pipx stores apps is on PATH
$ python3 setup.py test # run tests
$ make clean
$ python3 setup.py bdist_wheel # build a binary wheel
$ pipx install dist/* # install a binary wheel by pipx
$ plerr r1710
In order to get the latest updates just git pull origin master
and invoke a
command in the root of the project (sudo apt install make
if not yet
installed) make rai
to install to Python 3 user space site packages or
make raip
for pipx.
List of errors
Error codes with [+] mean they've got examples of bad and good code. Rationalisation provided for all entries.
Async Checker Messages
Basic Checker Messages
- C0102 (blacklisted-name) [+]
- C0103 (invalid-name) [+]
- C0112 (empty-docstring) [+]
- C0114 (missing-module-docstring) [+]
- C0115 (missing-class-docstring) [+]
- C0116 (missing-function-docstring) [+]
- C0121 (singleton-comparison) [+]
- C0122 (misplaced-comparison-constant) [+]
- C0123 (unidiomatic-typecheck) [+]
- E0100 (init-is-generator) [+]
- E0101 (return-in-init) [+]
- E0102 (function-redefined) [+]
- E0103 (not-in-loop) [+]
- E0104 (return-outside-function) [+]
- E0105 (yield-outside-function) [+]
- E0106 (return-arg-in-generator)
- E0107 (nonexistent-operator) [+]
- E0108 (duplicate-argument-name) [+]
- E0110 (abstract-class-instantiated) [+]
- E0111 (bad-reversed-sequence) [+]
- E0112 (too-many-star-expressions) [+]
- E0113 (invalid-star-assignment-target) [+]
- E0114 (star-needs-assignment-target) [+]
- E0115 (nonlocal-and-global) [+]
- E0116 (continue-in-finally) [+]
- E0117 (nonlocal-without-binding) [+]
- E0118 (used-prior-global-declaration) [+]
- E0119 (misplaced-format-function) [+]
- R0123 (literal-comparison) [+]
- R0124 (comparison-with-itself) [+]
- W0101 (unreachable) [+]
- W0102 (dangerous-default-value) [+]
- W0104 (pointless-statement) [+]
- W0105 (pointless-string-statement) [+]
- W0106 (expression-not-assigned) [+]
- W0107 (unnecessary-pass) [+]
- W0108 (unnecessary-lambda) [+]
- W0109 (duplicate-key) [+]
- W0111 (assign-to-new-keyword) [+]
- W0120 (useless-else-on-loop) [+]
- W0122 (exec-used) [+]
- W0123 (eval-used) [+]
- W0124 (confusing-with-statement) [+]
- W0125 (using-constant-test)
- W0126 (missing-parentheses-for-call-in-test)
- W0127 (self-assigning-variable) [+]
- W0128 (redeclared-assigned-name)
- W0143 (comparison-with-callable) [+]
- W0150 (lost-exception) [+]
- W0199 (assert-on-tuple) [+]
Broad Try Clause Checker Messages
Classes Checker Messages
- C0202 (bad-classmethod-argument) [+]
- C0203 (bad-mcs-method-argument) [+]
- C0204 (bad-mcs-classmethod-argument) [+]
- C0205 (single-string-used-for-slots) [+]
- E0202 (method-hidden) [+]
- E0203 (access-member-before-definition) [+]
- E0211 (no-method-argument) [+]
- E0213 (no-self-argument) [+]
- E0236 (invalid-slots-object) [+]
- E0237 (assigning-non-slot) [+]
- E0238 (invalid-slots) [+]
- E0239 (inherit-non-class) [+]
- E0240 (inconsistent-mro) [+]
- E0241 (duplicate-bases) [+]
- E0242 (class-variable-slots-conflict) [+]
- E0301 (non-iterator-returned) [+]
- E0302 (unexpected-special-method-signature) [+]
- E0303 (invalid-length-returned) [+]
- F0202 (method-check-failed)
- R0201 (no-self-use) [+]
- R0202 (no-classmethod-decorator) [+]
- R0203 (no-staticmethod-decorator) [+]
- R0205 (useless-object-inheritance) [+]
- R0206 (property-with-parameters) [+]
- W0201 (attribute-defined-outside-init) [+]
- W0211 (bad-staticmethod-argument) [+]
- W0212 (protected-access) [+]
- W0221 (arguments-differ) [+]
- W0222 (signature-differs)
- W0223 (abstract-method) [+]
- W0231 (super-init-not-called) [+]
- W0232 (no-init) [+]
- W0233 (non-parent-init-called) [+]
- W0235 (useless-super-delegation) [+]
- W0236 (invalid-overridden-method) [+]
Compare-To-Empty-String Checker Messages
Compare-To-Zero Checker Messages
Deprecated Builtins Checker Messages
Design Checker Messages
- R0901 (too-many-ancestors) [+]
- R0902 (too-many-instance-attributes) [+]
- R0903 (too-few-public-methods) [+]
- R0904 (too-many-public-methods) [+]
- R0911 (too-many-return-statements) [+]
- R0912 (too-many-branches) [+]
- R0913 (too-many-arguments) [+]
- R0914 (too-many-locals) [+]
- R0915 (too-many-statements) [+]
- R0916 (too-many-boolean-expressions) [+]
- R1260 (too-complex) [+]
Docstyle Checker Messages
Else If Used Checker Messages
Exceptions Checker Messages
- E0701 (bad-except-order) [+]
- E0702 (raising-bad-type) [+]
- E0703 (bad-exception-context) [+]
- E0704 (misplaced-bare-raise) [+]
- E0710 (raising-non-exception) [+]
- E0711 (notimplemented-raised) [+]
- E0712 (catching-non-exception) [+]
- W0702 (bare-except) [+]
- W0703 (broad-except) [+]
- W0705 (duplicate-except) [+]
- W0706 (try-except-raise) [+]
- W0707 (raise-missing-from) [+]
- W0711 (binary-op-exception) [+]
- W0715 (raising-format-tuple) [+]
- W0716 (wrong-exception-operation) [+]
Format Checker Messages
- C0301 (line-too-long) [+]
- C0302 (too-many-lines)
- C0303 (trailing-whitespace) [+]
- C0304 (missing-final-newline)
- C0305 (trailing-newlines)
- C0321 (multiple-statements) [+]
- C0325 (superfluous-parens) [+]
- C0326 (bad-whitespace) [+]
- C0327 (mixed-line-endings)
- C0328 (unexpected-line-ending-format)
- C0330 (bad-continuation)
- W0301 (unnecessary-semicolon) [+]
- W0311 (bad-indentation) [+]
- W0312 (mixed-indentation)
Imports Checker Messages
- C0410 (multiple-imports) [+]
- C0411 (wrong-import-order) [+]
- C0412 (ungrouped-imports) [+]
- C0413 (wrong-import-position) [+]
- C0414 (useless-import-alias) [+]
- C0415 (import-outside-toplevel) [+]
- E0401 (import-error) [+]
- E0402 (relative-beyond-top-level) [+]
- R0401 (cyclic-import) [+]
- W0401 (wildcard-import) [+]
- W0402 (deprecated-module) [+]
- W0404 (reimported) [+]
- W0406 (import-self) [+]
- W0407 (preferred-module) [+]
- W0410 (misplaced-future) [+]
Logging Checker Messages
- E1200 (logging-unsupported-format)
- E1201 (logging-format-truncated) [+]
- E1205 (logging-too-many-args)
- E1206 (logging-too-few-args)
- W1201 (logging-not-lazy) [+]
- W1202 (logging-format-interpolation) [+]
Miscellaneous Checker Messages
Multiple Types Checker Messages
Newstyle Checker Messages
Overlap-Except Checker Messages
Parameter Documentation Checker Messages
- W9005 (multiple-constructor-doc) [+]
- W9006 (missing-raises-doc) [+]
- W9008 (redundant-returns-doc)
- W9010 (redundant-yields-doc)
- W9011 (missing-return-doc) [+]
- W9012 (missing-return-type-doc) [+]
- W9013 (missing-yield-doc)
- W9014 (missing-yield-type-doc)
- W9015 (missing-param-doc) [+]
- W9016 (missing-type-doc) [+]
- W9017 (differing-param-doc) [+]
- W9018 (differing-type-doc) [+]
Refactoring Checker Messages
- C0113 (unneeded-not) [+]
- C0200 (consider-using-enumerate) [+]
- C0201 (consider-iterating-dictionary) [+]
- C1801 (len-as-condition) [+]
- R1701 (consider-merging-isinstance)
- R1702 (too-many-nested-blocks)
- R1703 (simplifiable-if-statement) [+]
- R1704 (redefined-argument-from-local) [+]
- R1705 (no-else-return) [+]
- R1706 (consider-using-ternary)
- R1707 (trailing-comma-tuple) [+]
- R1708 (stop-iteration-return) [+]
- R1709 (simplify-boolean-expression)
- R1710 (inconsistent-return-statements) [+]
- R1711 (useless-return) [+]
- R1712 (consider-swap-variables) [+]
- R1713 (consider-using-join) [+]
- R1714 (consider-using-in) [+]
- R1715 (consider-using-get)
- R1716 (chained-comparison) [+]
- R1717 (consider-using-dict-comprehension)
- R1718 (consider-using-set-comprehension)
- R1719 (simplifiable-if-expression) [+]
- R1720 (no-else-raise) [+]
- R1721 (unnecessary-comprehension) [+]
- R1722 (consider-using-sys-exit) [+]
- R1723 (no-else-break) [+]
- R1724 (no-else-continue) [+]
Similarities Checker Messages
Spelling Checker Messages
- C0401 (wrong-spelling-in-comment)
- C0402 (wrong-spelling-in-docstring)
- C0403 (invalid-characters-in-docstring)
Stdlib Checker Messages
- E1507 (invalid-envvar-value) [+]
- W1501 (bad-open-mode) [+]
- W1502 (boolean-datetime)
- W1503 (redundant-unittest-assert) [+]
- W1505 (deprecated-method)
- W1506 (bad-thread-instantiation) [+]
- W1507 (shallow-copy-environ) [+]
- W1508 (invalid-envvar-default) [+]
- W1509 (subprocess-popen-preexec-fn) [+]
- W1510 (subprocess-run-check) [+]
String Checker Messages
- E1300 (bad-format-character) [+]
- E1301 (truncated-format-string)
- E1302 (mixed-format-string) [+]
- E1303 (format-needs-mapping)
- E1304 (missing-format-string-key) [+]
- E1305 (too-many-format-args) [+]
- E1306 (too-few-format-args) [+]
- E1307 (bad-string-format-type) [+]
- E1310 (bad-str-strip-call)
- W1300 (bad-format-string-key)
- W1301 (unused-format-string-key)
- W1302 (bad-format-string) [+]
- W1303 (missing-format-argument-key) [+]
- W1304 (unused-format-string-argument) [+]
- W1305 (format-combined-specification) [+]
- W1306 (missing-format-attribute) [+]
- W1307 (invalid-format-index) [+]
- W1308 (duplicate-string-formatting-argument)
- W1401 (anomalous-backslash-in-string)
- W1402 (anomalous-unicode-escape-in-string) [+]
- W1403 (implicit-str-concat-in-sequence)
Typecheck Checker Messages
- E1101 (no-member) [+]
- E1102 (not-callable) [+]
- E1111 (assignment-from-no-return) [+]
- E1120 (no-value-for-parameter) [+]
- E1121 (too-many-function-args) [+]
- E1123 (unexpected-keyword-arg) [+]
- E1124 (redundant-keyword-arg) [+]
- E1125 (missing-kwoa)
- E1126 (invalid-sequence-index) [+]
- E1127 (invalid-slice-index) [+]
- E1128 (assignment-from-none) [+]
- E1129 (not-context-manager) [+]
- E1130 (invalid-unary-operand-type) [+]
- E1131 (unsupported-binary-operation) [+]
- E1132 (repeated-keyword)
- E1133 (not-an-iterable) [+]
- E1134 (not-a-mapping)
- E1135 (unsupported-membership-test) [+]
- E1136 (unsubscriptable-object) [+]
- E1137 (unsupported-assignment-operation) [+]
- E1138 (unsupported-delete-operation) [+]
- E1139 (invalid-metaclass)
- E1140 (unhashable-dict-key) [+]
- E1141 (dict-iter-missing-items) [+]
- I1101 (c-extension-no-member)
- W1113 (keyword-arg-before-vararg) [+]
- W1114 (arguments-out-of-order)
Variables Checker Messages
- E0601 (used-before-assignment) [+]
- E0602 (undefined-variable)
- E0603 (undefined-all-variable) [+]
- E0604 (invalid-all-object) [+]
- E0611 (no-name-in-module) [+]
- E0633 (unpacking-non-sequence) [+]
- W0601 (global-variable-undefined) [+]
- W0602 (global-variable-not-assigned) [+]
- W0603 (global-statement) [+]
- W0604 (global-at-module-level) [+]
- W0611 (unused-import) [+]
- W0612 (unused-variable) [+]
- W0613 (unused-argument) [+]
- W0614 (unused-wildcard-import) [+]
- W0621 (redefined-outer-name) [+]
- W0622 (redefined-builtin) [+]
- W0623 (redefine-in-handler)
- W0631 (undefined-loop-variable) [+]
- W0632 (unbalanced-tuple-unpacking) [+]
- W0640 (cell-var-from-loop) [+]
- W0641 (possibly-unused-variable)
- W0642 (self-cls-assignment)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.