Bowler icon indicating copy to clipboard operation
Bowler copied to clipboard

Basic source compatibility checker

Open thatch opened this issue 5 years ago • 1 comments

Many of the codemods I write would benefit from knowing whether a given file is compatible with python 2, python 3, or both. May as well report minor versions while we're at it. There's a long tail of things, but looking in the tree for print statements (2), f-strings (3) and typehints (3) are probably 90% of the way there.

Wherever this goes, we should be able to check its result from a filename_matcher as well as from a modifier func.

thatch avatar May 01 '19 18:05 thatch

Checkpoint: I have a prototype using parso -- it is not fast, fails to parse in any version with bad # type comments, and always obeys future imports though.

thatch avatar Jul 23 '19 05:07 thatch