summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorVincent <>2009-11-25 16:08:37 +0100
committerVincent <>2009-11-25 16:08:37 +0100
commit8d2aa9527d094e80bb97dff57c7940e498a3e6dd (patch)
treeedef24738bc27af9d15ce331cf6fa68aad3f3a41 /utils.py
parent2558f951fd4032e6bdaf2e7e4ae758b6e0bc6802 (diff)
downloadpylint-git-8d2aa9527d094e80bb97dff57c7940e498a3e6dd.tar.gz
fix #9791
https://www.logilab.net/elo/ticket/9791 In lint.py: * rename "--list-msgs" option into "--full-documentation", * add a specific "--list-msgs" option ant its callback, and in MessagesHandlerMixIn in utils.py: * rename list_messages() method into print_full_documentation(), * add list_checkers_messages() method, * add list_messages() method, *add list_sorted_messages().
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py28
1 files changed, 25 insertions, 3 deletions
diff --git a/utils.py b/utils.py
index a91d8c60a..06b2ba40a 100644
--- a/utils.py
+++ b/utils.py
@@ -279,7 +279,12 @@ class MessagesHandlerMixIn:
print
continue
- def list_messages(self):
+ def list_checkers_messages(self, checker):
+ """print checker's messages in reST format"""
+ for msg_id in sort_msgs(checker.msgs.keys()):
+ print self.get_message_help(msg_id, False)
+
+ def print_full_documentation(self):
"""output a full documentation in ReST format"""
for checker in sort_checkers(self._checkers.values()):
if checker.name == 'master':
@@ -313,8 +318,7 @@ class MessagesHandlerMixIn:
title = ('%smessages' % prefix).capitalize()
print title
print '~' * len(title)
- for msg_id in sort_msgs(checker.msgs.keys()):
- print self.get_message_help(msg_id, False)
+ self.list_checkers_messages( checker)
print
if getattr(checker, 'reports', None):
title = ('%sreports' % prefix).capitalize()
@@ -325,6 +329,24 @@ class MessagesHandlerMixIn:
print
print
+ def list_messages(self):
+ """output full messages list documentation in ReST format"""
+ for checker in sort_checkers(self._checkers.values()):
+ if checker.msgs:
+ self.list_checkers_messages( checker)
+ print
+
+ def list_sorted_messages(self):
+ """output full sorted messages list in ReST format"""
+ msg_ids = []
+ for checker in self._checkers.values():
+ for msg_id in checker.msgs.keys():
+ msg_ids.append(msg_id)
+ msg_ids.sort()
+ for msg_id in msg_ids:
+ print self.get_message_help(msg_id, False)
+ print
+
class ReportsHandlerMixIn:
"""a mix-in class containing all the reports and stats manipulation