Exemplo n.º 1
0
 def process_module(self, module):
     """Inspect the source file to find messages activated or deactivated by id."""
     managed_msgs = MessagesHandlerMixIn.get_by_id_managed_msgs()
     for (mod_name, msgid, symbol, lineno, is_disabled) in managed_msgs:
         if mod_name == module.name:
             verb = "disable" if is_disabled else "enable"
             txt = f"'{msgid}' is cryptic: use '# pylint: {verb}={symbol}' instead"
             self.add_message("use-symbolic-message-instead", line=lineno, args=txt)
     MessagesHandlerMixIn.clear_by_id_managed_msgs()
Exemplo n.º 2
0
 def process_module(self, module):
     """inspect the source file to find messages activated or deactivated by id."""
     managed_msgs = MessagesHandlerMixIn.get_by_id_managed_msgs()
     for (mod_name, msg_id, msg_symbol, lineno,
          is_disabled) in managed_msgs:
         if mod_name == module.name:
             verb = "disable" if is_disabled else "enable"
             txt = f"Id '{msg_id}' is used to {verb} '{msg_symbol}' message emission"
             self.add_message("use-symbolic-message-instead",
                              line=lineno,
                              args=txt)
     MessagesHandlerMixIn.clear_by_id_managed_msgs()
Exemplo n.º 3
0
 def process_module(self, module):
     """inspect the source file to find messages activated or deactivated by id."""
     managed_msgs = MessagesHandlerMixIn.get_by_id_managed_msgs()
     for (mod_name, msg_id, msg_symbol, lineno, is_disabled) in managed_msgs:
         if mod_name == module.name:
             if is_disabled:
                 txt = "Id '{ident}' is used to disable '{symbol}' message emission".format(
                     ident=msg_id, symbol=msg_symbol
                 )
             else:
                 txt = "Id '{ident}' is used to enable '{symbol}' message emission".format(
                     ident=msg_id, symbol=msg_symbol
                 )
             self.add_message("use-symbolic-message-instead", line=lineno, args=txt)
     MessagesHandlerMixIn.clear_by_id_managed_msgs()