diff options
Diffstat (limited to 'pylint/lint.py')
-rw-r--r-- | pylint/lint.py | 27 |
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() |