Reputation: 4767
Is there a place where I can get all pylint
codes that are used for warning/error messages?
When I tried searching the pylint
site for something like "C0114" (missing-module-docstring) I get no search results:
Where can I find all of these?
Looking in the code itself, it seems like they are scattered throughout all the files, so it would be nice to have a nice table showing all the possible codes if there's something like that possible:
.//pylint/checkers/strings.py: "W1401": (
.//pylint/checkers/strings.py: "W1402": (
.//pylint/checkers/strings.py: "W1404": (
.//pylint/checkers/strings.py: "W1405": (
.//pylint/extensions/empty_comment.py: "R2044": (
.//pylint/extensions/broad_try_clause.py: "W0717": (
.//pylint/extensions/docparams.py: "W9005": (
.//pylint/extensions/docparams.py: "W9006": (
.//pylint/extensions/docparams.py: "W9008": (
.//pylint/extensions/docparams.py: "W9010": (
...etc
Upvotes: 7
Views: 5487
Reputation: 4767
There are two ways you might want to get this:
To list all messages you can do:
$ pylint --list-msgs
:exception-escape (W1661): *Using an exception object that was bound by...
:comprehension-escape (W1662): *Using a variable that was bound inside a...
If you know the name of a specific message and want to look up its code you can do the above with the help of grep:
$ pylint --list-msgs |grep trailing-newlines
:trailing-newlines (C0305): *Trailing newlines*
Upvotes: 9
Reputation: 133919
PyLint documentation is almost as bad as its diagnostics - for PyLint 1.6.5 (which is ancient btw) the codes seem to be listed in Pylint features - likewise for latest release.
Upvotes: 6