Skip to content

Ignore multi-line calls in duplicate detection (R0801) #7920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Bengt opened this issue Dec 11, 2022 · 0 comments
Open

Ignore multi-line calls in duplicate detection (R0801) #7920

Bengt opened this issue Dec 11, 2022 · 0 comments
Labels
duplicate-code Related to code duplication checker Enhancement ✨ Improvement to a component Needs decision 🔒 Needs a decision before implemention or rejection

Comments

@Bengt
Copy link

Bengt commented Dec 11, 2022

Current problem

When I run PyLint on my code base, which contains many multi-line function calls like this:

return_value_0,
return_value_1,
return_value_2,
return_value_3 = \
    my_function(
        parameter_0,
        parameter_1,
        parameter_2,
        parameter_3,
)

PyLint complains over duplicate code:

R0801: Similar lines in 2 files

Note that while this call spans multiple lines, it is only a single statement. Maybe single statements should never be considered duplicates, as they might just be the canonical form? Maybe --ignore-multiline-statements would be a sensible name.

Desired solution

I would like PyLint to detect these multi-line duplicates as okay, since they are the canonical way of calling these functions in my style of formatting the code.

Additional context

@Pierre-Sassoulas suggested introducing an option like --ignore-multiline-calls (like other similarities checker options https://pylint.pycqa.org/en/latest/user_guide/configuration/all-options.html#similarities-checker) here: #214 (comment)

@Bengt Bengt added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Dec 11, 2022
@Pierre-Sassoulas Pierre-Sassoulas added Enhancement ✨ Improvement to a component duplicate-code Related to code duplication checker Needs decision 🔒 Needs a decision before implemention or rejection and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Dec 12, 2022
@ruro ruro marked this as a duplicate of #10319 Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate-code Related to code duplication checker Enhancement ✨ Improvement to a component Needs decision 🔒 Needs a decision before implemention or rejection
Projects
None yet
Development

No branches or pull requests

2 participants