Open pylint-bot opened 10 years ago
Original comment by Leon de Almeida (BitBucket: leondealmeida, GitHub: @leondealmeida?):
Added file with the test script
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):
right, though this is very dependant to the underlying python parser provided by the interpreter.
Original comment by Torsten Marek (BitBucket: tmarek, GitHub: @tmarek?):
Without a better AST implementation, it's not possible to determine on which line the function actually starts.
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):
Removing version: 1.0 (automated comment)
Originally reported by: Leon de Almeida (BitBucket: leondealmeida, GitHub: @leondealmeida?)
The error line is reported to be always one line after the last one of the decorator parameters with relevant data. The code below replicates it.
To validate the bug, add newlines below the
0
(last value on the decorators list). The test case is pretty much absurd - but more complex parameters (think the ones forpytest.mark.parametrize
) may introduce lists and tuples that will also reproduce this behaviour (which is my original scenario).Pylint output (-rn option):