diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-11-17 14:13:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-17 14:13:34 +0100 |
commit | b91cc8dbb47ce622b73c766b3a53da270bdb24e9 (patch) | |
tree | 72797301578a928011bf9d9c433d9b5482f2aa48 /pylint/lint/pylinter.py | |
parent | 7d2b6c9bd807dda7502e739c7b9fb2182d89f457 (diff) | |
download | pylint-git-b91cc8dbb47ce622b73c766b3a53da270bdb24e9.tar.gz |
Add error codes to all ``type: ignore`` (#5329)
Diffstat (limited to 'pylint/lint/pylinter.py')
-rw-r--r-- | pylint/lint/pylinter.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index 41f72a70f..72ab3637c 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -974,7 +974,7 @@ class PyLinter( "In pylint 3.0, the checkers check function will only accept sequence of string", DeprecationWarning, ) - files_or_modules = (files_or_modules,) # type: ignore + files_or_modules = (files_or_modules,) # type: ignore[assignment] if self.config.from_stdin: if len(files_or_modules) != 1: raise exceptions.InvalidArgsError( @@ -1336,12 +1336,12 @@ class PyLinter( if confidence is None: confidence = interfaces.UNDEFINED if self.config.confidence and confidence.name not in self.config.confidence: - return MSG_STATE_CONFIDENCE # type: ignore # mypy does not infer Literal correctly + return MSG_STATE_CONFIDENCE # type: ignore[return-value] # mypy does not infer Literal correctly try: if line in self.file_state._module_msgs_state[msgid]: - return MSG_STATE_SCOPE_MODULE # type: ignore + return MSG_STATE_SCOPE_MODULE # type: ignore[return-value] except (KeyError, TypeError): - return MSG_STATE_SCOPE_CONFIG # type: ignore + return MSG_STATE_SCOPE_CONFIG # type: ignore[return-value] return None def _is_one_message_enabled(self, msgid: str, line: Optional[int]) -> bool: @@ -1415,7 +1415,7 @@ class PyLinter( if line is None and node is not None: line = node.fromlineno if col_offset is None and hasattr(node, "col_offset"): - col_offset = node.col_offset # type: ignore + col_offset = node.col_offset # type: ignore[union-attr] # should this message be displayed if not self.is_message_enabled(message_definition.msgid, line, confidence): |