<#21040 [Call-by-name] Investigate using concrete ...
# github-notifications
c
#21040 [Call-by-name] Investigate using concrete syntax trees for migration code Issue created by sureshjoshi We're really stretching the term "abstract" in this migration code. There are conditional code replacements, specific trailing comma hacks, ignored/warnings if there are comments inside of a replacement region, and the code replacement function using
fileinput
is brittle.
libcst
(for example) has nice matcher code to clean up some of the visitor code, and maybe the visitor recursion, and the CST would help stabilize code replacement. Additionally, I'm using
libcst
in another Pants migration tool that I'm experimenting with, and it makes migrations trivial by comparison to using the ast. My guess is that we could probably remove 10-15% of the migration code. pantsbuild/pants