summaryrefslogtreecommitdiff
path: root/pylint/lint.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2019-02-13 10:57:21 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2019-02-13 10:57:21 +0100
commit46faee298e54727abd253031cd1314bbad6c9ed9 (patch)
tree71c5f48ee576534028b0c4eeae0b7c945c3a0074 /pylint/lint.py
parentfa52e7da184435ed2c472a86f854e386594ae99a (diff)
downloadpylint-git-46faee298e54727abd253031cd1314bbad6c9ed9.tar.gz
Added a new command line option ``list-groups`` for listing all the check groups ``pylint`` knows about.
Diffstat (limited to 'pylint/lint.py')
-rw-r--r--pylint/lint.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/pylint/lint.py b/pylint/lint.py
index 26d79abd7..017c68547 100644
--- a/pylint/lint.py
+++ b/pylint/lint.py
@@ -878,6 +878,11 @@ class PyLinter(
if c is not self
]
+ def get_checker_names(self):
+ """Get all the checker names that this linter knows about."""
+ checkers = self.get_checkers()
+ return sorted({check.name for check in checkers if check.name != "master"})
+
def prepare_checkers(self):
"""return checkers needed for activated messages and reports"""
if not self.config.reports:
@@ -1435,6 +1440,17 @@ group are mutually exclusive.",
},
),
(
+ "list-groups",
+ {
+ "action": "callback",
+ "metavar": "<msg-id>",
+ "callback": self.cb_list_groups,
+ "group": "Commands",
+ "level": 1,
+ "help": "List pylint's message groups.",
+ },
+ ),
+ (
"list-conf-levels",
{
"action": "callback",
@@ -1660,6 +1676,17 @@ group are mutually exclusive.",
self.linter.msgs_store.list_messages()
sys.exit(0)
+ def cb_list_groups(self, *args, **kwargs):
+ """List all the check groups that pylint knows about
+
+ These should be useful to know what check groups someone can disable
+ or enable.
+ """
+ checkers = self.linter.get_checker_names()
+ for check in checkers:
+ print(check)
+ sys.exit(0)
+
def cb_python3_porting_mode(self, *args, **kwargs):
"""Activate only the python3 porting checker."""
self.linter.python3_porting_mode()