diff options
Diffstat (limited to 'pylint/checkers/similar.py')
-rw-r--r-- | pylint/checkers/similar.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py index 2cfba16bf..2b08204f2 100644 --- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ -1,6 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html -# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt +# For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE +# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt """A similarities / code duplication command line tool and pylint checker. @@ -848,15 +848,17 @@ class SimilarChecker(BaseRawFileChecker, Similar): stream must implement the readlines method """ if self.linter.current_name is None: + # TODO: 3.0 Fix current_name warnings.warn( ( "In pylint 3.0 the current_name attribute of the linter object should be a string. " "If unknown it should be initialized as an empty string." ), DeprecationWarning, + stacklevel=2, ) with node.stream() as stream: - self.append_stream(self.linter.current_name, stream, node.file_encoding) # type: ignore[arg-type] + self.append_stream(self.linter.current_name, stream, node.file_encoding) def close(self) -> None: """Compute and display similarities on closing (i.e. end of parsing).""" |