logilab-astng #50395 False positive C0322 with multi-line function decorator call using a keyword argument [validation pending]

The following function declaration incorrectly gives a C0322 ("Operator not preceded by a space") error.

@f(a=2,
b=3)
def g1(x):
print x

The following three elements need to all be present in order to generate this error:

-- using a function call expression as a function decorator
-- the expression must be split over multiple lines
-- the function is called using a keyword argument

A more full example is below.

$ cat /tmp/test.py
def f(a, b):
print a, b

# Generates C0322.
@f(a=2,
b=3)
def g1(x):
print x

# The following are all fine.
@f(a=2,
b=3)
def g2():
pass

@f(a=2, b=3)
def g3(x):
print x

f(a=2,
b=3)

$ pylint /tmp/test.py
************* Module test
C0322: 6:g1: Operator not preceded by a space
b=3)
^
def g1(x):

prioritynormal
typebug
done in0.24.1
load left0.000
closed by#77a24b16b91f fix function fromlineno when some decorator is splited on multiple lines. Closes #50395