diff options
| author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2009-01-28 10:10:07 +0100 | 
|---|---|---|
| committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2009-01-28 10:10:07 +0100 | 
| commit | b734c03d03da0b0b932c40044de18825637db0b2 (patch) | |
| tree | 72a8eeea4e7e9cfde3830765e1fc38732aca56e3 /utils.py | |
| parent | b657285c78089cf4e5c5159acfcb3f88ae51bef8 (diff) | |
| download | pylint-git-b734c03d03da0b0b932c40044de18825637db0b2.tar.gz | |
enhance m.kiilerich patch so exit status code may be somewhat controlled (eg which message categories will trigger non zero status code)
Diffstat (limited to 'utils.py')
| -rw-r--r-- | utils.py | 8 | 
1 files changed, 4 insertions, 4 deletions
@@ -41,7 +41,6 @@ MSG_TYPES = {      'E' : 'error',      'F' : 'fatal'      } -MSG_CATEGORIES = MSG_TYPES.keys()  def sort_checkers(checkers): @@ -52,7 +51,7 @@ def sort_checkers(checkers):  def sort_msgs(msg_ids):      """sort message identifiers according to their category first""" -    msg_order = ['E', 'W', 'R', 'C', 'I', 'F'] +    msg_order = 'EWRCIF'      def cmp_func(msgid1, msgid2):          """comparison function for two message identifiers"""          if msgid1[0] != msgid2[0]: @@ -82,7 +81,7 @@ def get_module_and_frameid(node):  class Message:      def __init__(self, checker, msgid, msg, descr):          assert len(msgid) == 5, 'Invalid message id %s' % msgid -        assert msgid[0] in MSG_CATEGORIES, \ +        assert msgid[0] in MSG_TYPES, \                 'Bad message type %s in %r' % (msgid[0], msgid)          self.msgid = msgid          self.msg = msg @@ -241,8 +240,9 @@ class MessagesHandlerMixIn:          if not self.is_message_enabled(msg_id, line):              return                  # update stats -        self.msg_counter += 1          msg_cat = MSG_TYPES[msg_id[0]] +        if msg_id[0] not in self.config.zero_status_cat: +            self.msg_counter += 1          self.stats[msg_cat] += 1          self.stats['by_module'][self.current_name][msg_cat] += 1          try:  | 
