pylint-dev / pylint

It's not just a linter that annoys you!
https://pylint.readthedocs.io/en/latest/
GNU General Public License v2.0
5.29k stars 1.13k forks source link

Trailing comma tuple check misses multi-line tuples #2007

Closed nivekuil closed 4 years ago

nivekuil commented 6 years ago

Steps to reproduce

"""test.py"""
A = ['f',
    ],
print(A)

pylint test.py
No config file found, using default configuration

Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

python test.py
(['f'],)

Current behavior

No error

Expected behavior

Pylint should complain

pylint --version output

No config file found, using default configuration pylint 1.8.3, astroid 1.6.2 Python 3.6.4 (default, Jan 5 2018, 02:35:40) [GCC 7.2.1 20171224]

PCManticore commented 6 years ago

Thanks for the issue! Might be a bit tricky, as the current trailing-comma-check is a bit limited, but might be doable.

dhensen commented 5 years ago

This bit us twice this week, any indication on a time-window for a fix?

PCManticore commented 5 years ago

@dhensen No, there's no time window for this fix. If this is important, feel free to take a stab at implementing a PR, but it's pretty low on my priority list.

kkew3 commented 5 years ago

Another failed case for multiline function call ... got bit today ...

def f(_):
    return None

decider = f(
    0),

It would be great if it could be fixed some day. Thanks