summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2020-06-08 08:25:54 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2020-06-08 08:25:54 +0200
commit468ee5dc057486d3aea455100e801bed3e5b4549 (patch)
tree7ece766dd691bc8a4708d55b742a5a5f780b93b0
parent57ed36292e498dc77f65c8c455dc441ac6dc9639 (diff)
downloadpylint-git-468ee5dc057486d3aea455100e801bed3e5b4549.tar.gz
Fix a bug with `ignore-docstrings` ignoring all lines in a module
-rw-r--r--CONTRIBUTORS.txt2
-rw-r--r--ChangeLog2
-rw-r--r--tests/regrtest_data/duplicate_data_raw_strings/first.py11
-rw-r--r--tests/regrtest_data/duplicate_data_raw_strings/second.py11
-rw-r--r--tests/test_self.py8
5 files changed, 34 insertions, 0 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 9b3c69550..4bcf7a1b9 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -387,3 +387,5 @@ contributors:
* Daniel R. Neal (danrneal): contributer
* Jeremy Fleischman (jfly): contributer
+
+* Shiv Venkatasubrahmanyam
diff --git a/ChangeLog b/ChangeLog
index 351e0e6f1..1b4213695 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,8 @@ Release date: TBA
* Add an faq detailing which messages to disable to avoid duplicates w/ other popular linters
+* Fix a bug with `ignore-docstrings` ignoring all lines in a module
+
What's New in Pylint 2.5.3?
===========================
diff --git a/tests/regrtest_data/duplicate_data_raw_strings/first.py b/tests/regrtest_data/duplicate_data_raw_strings/first.py
new file mode 100644
index 000000000..687c5922e
--- /dev/null
+++ b/tests/regrtest_data/duplicate_data_raw_strings/first.py
@@ -0,0 +1,11 @@
+r"""A raw docstring.
+"""
+
+
+def look_busy():
+ xxxx = 1
+ yyyy = 2
+ zzzz = 3
+ wwww = 4
+ vvvv = xxxx + yyyy + zzzz + wwww
+ return vvvv
diff --git a/tests/regrtest_data/duplicate_data_raw_strings/second.py b/tests/regrtest_data/duplicate_data_raw_strings/second.py
new file mode 100644
index 000000000..687c5922e
--- /dev/null
+++ b/tests/regrtest_data/duplicate_data_raw_strings/second.py
@@ -0,0 +1,11 @@
+r"""A raw docstring.
+"""
+
+
+def look_busy():
+ xxxx = 1
+ yyyy = 2
+ zzzz = 3
+ wwww = 4
+ vvvv = xxxx + yyyy + zzzz + wwww
+ return vvvv
diff --git a/tests/test_self.py b/tests/test_self.py
index 6c27fd6cd..34e5d1290 100644
--- a/tests/test_self.py
+++ b/tests/test_self.py
@@ -783,3 +783,11 @@ class TestRunTC:
path = join(HERE, "regrtest_data", "unused_variable.py")
expected = "Your code has been rated at 7.50/10"
self._test_output([path, "--jobs=2", "-ry"], expected_output=expected)
+
+ def test_duplicate_code_raw_strings(self):
+ path = join(HERE, "regrtest_data", "duplicate_data_raw_strings")
+ expected_output = "Similar lines in 2 files"
+ self._test_output(
+ [path, "--disable=all", "--enable=duplicate-code"],
+ expected_output=expected_output,
+ )