You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 I warn(), the warning persists in the Context for all subsequent files processed by that instance of the Codemod, and so I see spurious warnings attached to the wrong filename:
> python3 -m libcst.tool codemod --hide-blacklisted-warnings -x icetray_codemod.ApplyStubsToSubclasses --stubs ../codemod/stubs.pkl --exclude-patterns 'icecube\.gulliver' sim-servicesCalculating full-repo metadata...Executing codemod...1.82s 6% complete, 27.87s estimated for 46 files to go...Found 1 error (1 fixed, 0 remaining).Codemodding /Users/jakob/Documents/IceCube/metaprojects/icetray/src/sim-services/python/gcd_validation/gcd_sanity_checker.pyWARNING: Mismatched arguments. icecube.icetray.I3Module.Finish has 1/0/0 pos-only/normal/kw-only params, I3GCDSanityChecker.Finish has 0/2/0 Successfully codemodded /Users/jakob/Documents/IceCube/metaprojects/icetray/src/sim-services/python/gcd_validation/gcd_sanity_checker.py with warningsCodemodding /Users/jakob/Documents/IceCube/metaprojects/icetray/src/sim-services/python/gcd_validation/hit_generator.pyWARNING: Mismatched arguments. icecube.icetray.I3Module.Finish has 1/0/0 pos-only/normal/kw-only params, I3GCDSanityChecker.Finish has 0/2/0 Successfully codemodded /Users/jakob/Documents/IceCube/metaprojects/icetray/src/sim-services/python/gcd_validation/hit_generator.py with warningsCodemodding /Users/jakob/Documents/IceCube/metaprojects/icetray/src/sim-services/python/gcd_validation/pe_generator.pyWARNING: Mismatched arguments. icecube.icetray.I3Module.Finish has 1/0/0 pos-only/normal/kw-only params, I3GCDSanityChecker.Finish has 0/2/0 Successfully codemodded /Users/jakob/Documents/IceCube/metaprojects/icetray/src/sim-services/python/gcd_validation/pe_generator.py with warningsCodemodding /Users/jakob/Documents/IceCube/metaprojects/icetray/src/sim-services/python/label_events/__init__.pyWARNING: Mismatched arguments. icecube.icetray.I3Module.Finish has 1/0/0 pos-only/normal/kw-only params, I3GCDSanityChecker.Finish has 0/2/0 Successfully codemodded /Users/jakob/Documents/IceCube/metaprojects/icetray/src/sim-services/python/label_events/__init__.py with warningsFinished codemodding 49 files! - Transformed 31 files successfully. - Skipped 18 files. - Failed to codemod 0 files. - 4 warnings were generated.
Is this the expected behavior?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: