-
-
Couldn't load subscription status.
- Fork 1.2k
Closed
Labels
Bug 🪲False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the code
Milestone
Description
#4648 follow-up.
Steps to reproduce
Given multiple files:
module\
__init__.py
a.py
b.py
a.py:
def example_func(
arg1,
arg2,
arg3,
arg4,
):
"""Valid function definition with docstring only."""b.py:
def example_func(
arg1,
arg2,
arg3,
arg4,
):
"""Valid function definition with docstring only."""Current behavior
Result of pylint --disable=all --enable=similarities --ignore-signatures=yes module:
************* Module module.b
module/b.py:1:0: R0801: Similar lines in 2 files
==module.a:0
==module.b:0
def example_func(
arg1,
arg2,
arg3,
arg4,
):
"""Valid function definition with docstring only.""" (duplicate-code)
-----------------------------------
Your code has been rated at 5.00/10
Expected behavior
duplicate-code error shouldn't be reported in this case.
Note: if functions have bodies everything works correctly. You could add pass to the example functions above and no duplicate-code error would be reported.
pylint --version output
Result of pylint --version output:
pylint 2.9.3
astroid 2.6.2
Python 3.8.2 (default, Jun 8 2021, 11:59:35)
[Clang 12.0.5 (clang-1205.0.22.11)]
Metadata
Metadata
Assignees
Labels
Bug 🪲False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the code