Package: plerr
A list of pylint-errors with reasoning and examples of erroneous and correct code.Table of contentsCLI usageStable releaseDev buildsList of errorsCLI usageIt's not required to install CLI util as long as you can navigate list of
errorshereor on thisweb-sitebut you may want to do so.Stable releaseYou can install a stable release simply by such commands:$python3-mpipinstallplerr$plerrr1710Forpipx:$python3-mpipinstallpipx# if not yet installed pipx$python3-mpipxensurepath# ensure directory where pipx stores apps is on PATH$pipxinstallplerr$plerrr1710Dev buildsIn order to use developmentplerrbuilds you need to invoke the following commands:$gitclonehttps://github.com/britonad/pylint-errors.git$sudoaptupdate&&sudoaptinstall-ypython3-pip# if not yet installed$cdpylint-errors$python3setup.pytest$python3setup.pyinstall--user$python3-mplerrr1710pipxusers may install the library by
such commands:$gitclonehttps://github.com/britonad/pylint-errors.git$sudoaptinstall-ymakepython3-pippython3-venv# if not yet installed$cdpylint-errors$python3-mpipinstallpipxwheel# install a package to build a wheel and pipx$python3-mpipxensurepath# ensure directory where pipx stores apps is on PATH$python3setup.pytest# run tests$makeclean$python3setup.pybdist_wheel# build a binary wheel$pipxinstalldist/*# install a binary wheel by pipx$plerrr1710In order to get the latest updates justgit pull origin masterand invoke a
command in the root of the project (sudo apt install makeif not yet
installed)make raito install to Python 3 user space site packages ormake raipfor pipx.List of errorsError codes with[+]mean they've got examples of bad and good code.
Rationalisation provided for all entries.Async Checker MessagesE1700 (yield-inside-async-function)[+]E1701 (not-async-context-manager)[+]Basic Checker MessagesC0102 (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 MessagesW0717 (too-many-try-statements)Classes Checker MessagesC0202 (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 MessagesC1901 (compare-to-empty-string)[+]Compare-To-Zero Checker MessagesC2001 (compare-to-zero)[+]Deprecated Builtins Checker MessagesW0141 (bad-builtin)[+]Design Checker MessagesR0901 (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 MessagesC0198 (bad-docstring-quotes)[+]C0199 (docstring-first-line-empty)[+]Else If Used Checker MessagesR5501 (else-if-used)[+]Exceptions Checker MessagesE0701 (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 MessagesC0301 (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 MessagesC0410 (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 MessagesE1200 (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 MessagesI0023 (use-symbolic-message-instead)W0511 (fixme)[+]Multiple Types Checker MessagesR0204 (redefined-variable-type)Newstyle Checker MessagesE1003 (bad-super-call)[+]Overlap-Except Checker MessagesW0714 (overlapping-except)Parameter Documentation Checker MessagesW9005 (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 MessagesC0113 (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 MessagesR0801 (duplicate-code)Spelling Checker MessagesC0401 (wrong-spelling-in-comment)C0402 (wrong-spelling-in-docstring)C0403 (invalid-characters-in-docstring)Stdlib Checker MessagesE1507 (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 MessagesE1300 (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 MessagesE1101 (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 MessagesE0601 (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)