Open jvansanten opened 2 months ago
It's a bug in libcst.tool
. There is a PR to fix it, but it was never merged: https://github.com/Instagram/LibCST/pull/665
@jvansanten Should be fixed now in the main branch! There was no release yet, so you would need to build from source if you'd like to check it out.
I've been playing around with using libcst to copy (newly added) annotations from base class stubs to subclasses in a large legacy codebase. It's pretty neat!
There are some edge cases in this that I can't handle, and so kick them up to the user with
Codemod.warn()
. There is, however a minor UX issue when processing multiple files in one invocation: once Iwarn()
, the warning persists in theContext
for all subsequent files processed by that instance of theCodemod
, and so I see spurious warnings attached to the wrong filename:Is this the expected behavior?