summaryrefslogtreecommitdiff
path: root/pylint/checkers/similar.py
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2022-03-13 13:15:46 +0100
committerGitHub <noreply@github.com>2022-03-13 13:15:46 +0100
commit663a2be7abd407fc680f426155ba26becaaa278d (patch)
treefe0b64a75fe24093b6f26018d82e5b5477a13d3c /pylint/checkers/similar.py
parent7981ec021b84c6f2b216202c1c028da4b0ee995b (diff)
downloadpylint-git-663a2be7abd407fc680f426155ba26becaaa278d.tar.gz
Upgrade ``pydocstringformatter`` to ``0.5.0`` (#5910)
Diffstat (limited to 'pylint/checkers/similar.py')
-rw-r--r--pylint/checkers/similar.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py
index 5287e3127..8e6eee92d 100644
--- a/pylint/checkers/similar.py
+++ b/pylint/checkers/similar.py
@@ -109,9 +109,8 @@ STREAM_TYPES = Union[TextIO, BufferedReader, BytesIO]
class CplSuccessiveLinesLimits:
- """This class holds a couple of SuccessiveLinesLimits objects, one for each file compared,
- and a counter on the number of common lines between both stripped lines collections extracted
- from both files
+ """Holds a SuccessiveLinesLimits object for each file compared and a
+ counter on the number of common lines between both stripped lines collections extracted from both files
"""
__slots__ = ("first_file", "second_file", "effective_cmn_lines_nb")
@@ -230,7 +229,9 @@ LinesChunkLimits_T = Tuple["LineSet", LineNumber, LineNumber]
def hash_lineset(
lineset: "LineSet", min_common_lines: int = DEFAULT_MIN_SIMILARITY_LINE
) -> Tuple[HashToIndex_T, IndexToLines_T]:
- """Return two dicts. The first associates the hash of successive stripped lines of a lineset
+ """Return two dicts.
+
+ The first associates the hash of successive stripped lines of a lineset
to the indices of the starting lines.
The second dict, associates the index of the starting line in the lineset's stripped lines to the
couple [start, end] lines number in the corresponding file.
@@ -318,9 +319,12 @@ def filter_noncode_lines(
stindex_2: Index,
common_lines_nb: int,
) -> int:
- """Return the effective number of common lines between lineset1 and lineset2 filtered from non code lines, that is to say the number of
- common successive stripped lines except those that do not contain code (for example a ligne with only an
- ending parathensis)
+ """Return the effective number of common lines between lineset1
+ and lineset2 filtered from non code lines.
+
+ That is to say the number of common successive stripped
+ lines except those that do not contain code (for example
+ a line with only an ending parathensis)
:param ls_1: first lineset
:param stindex_1: first lineset starting index
@@ -665,6 +669,7 @@ def stripped_lines(
@functools.total_ordering
class LineSet:
"""Holds and indexes all the lines of a single source file.
+
Allows for correspondence between real lines of the source file and stripped ones, which
are the real ones from which undesired patterns have been removed.
"""
@@ -737,9 +742,10 @@ def report_similarities(
# wrapper to get a pylint checker from the similar class
class SimilarChecker(BaseChecker, Similar, MapReduceMixin):
- """Checks for similarities and duplicated code. This computation may be
- memory / CPU intensive, so you should disable it if you experiment some
- problems.
+ """Checks for similarities and duplicated code.
+
+ This computation may be memory / CPU intensive, so you
+ should disable it if you experiment some problems.
"""
__implements__ = (IRawChecker,)