"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pylint/lint/message_state_handler.py" between
pylint-2.14.1.tar.gz and pylint-2.14.2.tar.gz

About: pylint analyzes Python source code looking for bugs and signs of poor quality.

message_state_handler.py  (pylint-2.14.1):message_state_handler.py  (pylint-2.14.2)
skipping to change at line 228 skipping to change at line 228
line: int | None = None, line: int | None = None,
ignore_unknown: bool = False, ignore_unknown: bool = False,
) -> None: ) -> None:
"""Enable a message for a scope.""" """Enable a message for a scope."""
self._set_msg_status( self._set_msg_status(
msgid, enable=True, scope=scope, line=line, ignore_unknown=ignore_un known msgid, enable=True, scope=scope, line=line, ignore_unknown=ignore_un known
) )
self._register_by_id_managed_msg(msgid, line, is_disabled=False) self._register_by_id_managed_msg(msgid, line, is_disabled=False)
def disable_noerror_messages(self) -> None: def disable_noerror_messages(self) -> None:
for msgcat, msgids in self.linter.msgs_store._msgs_by_category.items(): """Disable message categories other than `error` and `fatal`."""
# enable only messages with 'error' severity and above ('fatal') for msgcat in self.linter.msgs_store._msgs_by_category:
if msgcat in {"E", "F"}: if msgcat in {"E", "F"}:
for msgid in msgids: continue
self.enable(msgid) self.disable(msgcat)
else:
for msgid in msgids:
self.disable(msgid)
def list_messages_enabled(self) -> None: def list_messages_enabled(self) -> None:
emittable, non_emittable = self.linter.msgs_store.find_emittable_message s() emittable, non_emittable = self.linter.msgs_store.find_emittable_message s()
enabled: list[str] = [] enabled: list[str] = []
disabled: list[str] = [] disabled: list[str] = []
for message in emittable: for message in emittable:
if self.is_message_enabled(message.msgid): if self.is_message_enabled(message.msgid):
enabled.append(f" {message.symbol} ({message.msgid})") enabled.append(f" {message.symbol} ({message.msgid})")
else: else:
disabled.append(f" {message.symbol} ({message.msgid})") disabled.append(f" {message.symbol} ({message.msgid})")
skipping to change at line 411 skipping to change at line 408
self.linter.add_message("file-ignored", line=start[0 ]) self.linter.add_message("file-ignored", line=start[0 ])
self._ignore_file = True self._ignore_file = True
return return
# If we did not see a newline between the previous l ine and now, # If we did not see a newline between the previous l ine and now,
# we saw a backslash so treat the two lines as one. # we saw a backslash so treat the two lines as one.
l_start = start[0] l_start = start[0]
if not saw_newline: if not saw_newline:
l_start -= 1 l_start -= 1
try: try:
meth(msgid, "module", l_start) meth(msgid, "module", l_start)
except exceptions.DeletedMessageError as e: except (
exceptions.DeletedMessageError,
exceptions.MessageBecameExtensionError,
) as e:
self.linter.add_message( self.linter.add_message(
"useless-option-value", "useless-option-value",
args=(pragma_repr.action, e), args=(pragma_repr.action, e),
line=start[0], line=start[0],
confidence=HIGH, confidence=HIGH,
) )
except exceptions.UnknownMessageError: except exceptions.UnknownMessageError:
self.linter.add_message( self.linter.add_message(
"unknown-option-value", "unknown-option-value",
args=(pragma_repr.action, msgid), args=(pragma_repr.action, msgid),
 End of changes. 3 change blocks. 
8 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)