From 468ee5dc057486d3aea455100e801bed3e5b4549 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Mon, 8 Jun 2020 08:25:54 +0200 Subject: Fix a bug with `ignore-docstrings` ignoring all lines in a module --- CONTRIBUTORS.txt | 2 ++ ChangeLog | 2 ++ tests/regrtest_data/duplicate_data_raw_strings/first.py | 11 +++++++++++ tests/regrtest_data/duplicate_data_raw_strings/second.py | 11 +++++++++++ tests/test_self.py | 8 ++++++++ 5 files changed, 34 insertions(+) create mode 100644 tests/regrtest_data/duplicate_data_raw_strings/first.py create mode 100644 tests/regrtest_data/duplicate_data_raw_strings/second.py 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, + ) -- cgit v1.2.1