Bowler
Bowler copied to clipboard
Basic source compatibility checker
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.
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.