summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShiv Venkatasubrahmanyam <shvenkat@users.noreply.github.com>2020-06-07 23:25:12 -0700
committerGitHub <noreply@github.com>2020-06-08 08:25:12 +0200
commit57ed36292e498dc77f65c8c455dc441ac6dc9639 (patch)
treea9387b5a39d42279f93dc7a5f360ea461d162460
parentbd4548f1954a2047af2328c1c0cd81cd8dbe0151 (diff)
downloadpylint-git-57ed36292e498dc77f65c8c455dc441ac6dc9639.tar.gz
Ignore raw docstrings as well for ignore-docstrings
-rw-r--r--pylint/checkers/similar.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py
index 96c870f51..99c5ecbb1 100644
--- a/pylint/checkers/similar.py
+++ b/pylint/checkers/similar.py
@@ -179,11 +179,13 @@ def stripped_lines(lines, ignore_comments, ignore_docstrings, ignore_imports):
for lineno, line in enumerate(lines, start=1):
line = line.strip()
if ignore_docstrings:
- if not docstring and any(
- line.startswith(i) for i in ['"""', "'''", 'r"""', "r'''"]
- ):
- docstring = line[:3]
- line = line[3:]
+ if not docstring:
+ if line.startswith('"""') or line.startswith("'''"):
+ docstring = line[:3]
+ line = line[3:]
+ elif line.startswith('r"""') or line.startswith("r'''"):
+ docstring = line[1:4]
+ line = line[4:]
if docstring:
if line.endswith(docstring):
docstring = None