basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

Store the line of src an error is on in the baseline

Open KotlinIsland opened this issue 3 years ago • 6 comments

Storing the source code snippet is a really solid way to improve matching, especially on static error messages like no-any-expr.

KotlinIsland avatar May 19 '22 05:05 KotlinIsland

isn't that what it used to do?

DetachHead avatar May 20 '22 16:05 DetachHead

Not the line number, the actual source code on that line.

KotlinIsland avatar May 21 '22 01:05 KotlinIsland

Would it be possible / a good idea to store the whole statement, in cases of multi-line statements?

Zeckie avatar May 26 '22 10:05 Zeckie

I think it would be best to store the AST of the statement, as then you could even avoid formatting alterations.

KotlinIsland avatar May 26 '22 12:05 KotlinIsland

Is mypy's ast stable across different mypy / python versions?

Zeckie avatar May 27 '22 10:05 Zeckie

Could it store the source code, but compare by converting both to AST?

Zeckie avatar May 30 '22 12:05 Zeckie