Skip to content

Commit

Permalink
Fix AstroidError in similarity checker with imports/signatures igno…
Browse files Browse the repository at this point in the history
…red (pylint-dev#6357)

Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
  • Loading branch information
2 people authored and Sam M W committed Apr 29, 2022
1 parent 52ebeb3 commit a080aef
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pylint/checkers/similar.py
Expand Up @@ -35,6 +35,7 @@
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
List,
NamedTuple,
Expand Down Expand Up @@ -375,10 +376,10 @@ def append_stream(
LineSet(
streamid,
lines,
self.namespace.ignore_comments,
self.namespace.ignore_docstrings,
self.namespace.ignore_imports,
self.namespace.ignore_signatures,
self.ignore_comments,
self.ignore_docstrings,
self.ignore_imports,
self.ignore_signatures,
line_enabled_callback=self.linter._is_one_message_enabled # type: ignore[attr-defined]
if hasattr(self, "linter")
else None,
Expand Down Expand Up @@ -559,8 +560,8 @@ def stripped_lines(
ignore_docstrings: bool,
ignore_imports: bool,
ignore_signatures: bool,
line_enabled_callback: Callable[[str, int], bool] | None = None,
) -> list[LineSpecifs]:
line_enabled_callback: Union[Callable[[str, int], bool], None] = None,
) -> List[LineSpecifs]:
"""Return tuples of line/line number/line type with leading/trailing whitespace and any ignored code features removed.
:param lines: a collection of lines
Expand Down Expand Up @@ -670,7 +671,7 @@ def __init__(
ignore_docstrings: bool = False,
ignore_imports: bool = False,
ignore_signatures: bool = False,
line_enabled_callback: Callable[[str, int], bool] | None = None,
line_enabled_callback: Union[Callable[[str, int], bool], None] = None,
) -> None:
self.name = name
self._real_lines = lines
Expand Down

0 comments on commit a080aef

Please sign in to comment.