split codemod into two packages.
I'm not certain if I should be raising this against your project as it's actually a fork of @greenealexander where he adds a 'non-interactive' mode.
This is a rather large commit as it splits codemod into two packages.
The original codemod package works as it always has (all unit tests pass).
The new codemod_core puts the scanning and patch logic into a separate package that can be used as an API. codemod_core performs no interaction with the CLI so it can be used in any Dart app.
I've also introduced a new ChangeSet which describes a set of patches to be applied to a single dart library.
This is possibly more performant than the existing code as it now reads/writes the file once.
This code somewhat inverts the logic as it applies all selectors to a file rather than all files to the selector.
If you want to process all files for a single selector then you should create a PatchGenerator for a single selector, apply the patches and then do the same for the next selector.
Here the code is, use it as you will or not.
Security Insights
No security relevant content was detected by automated scans.
Action Items
- Review PR for security impact; comment "security review required" if needed or unsure
- Verify
aviary.yamlcoverage of security relevant code
Questions or Comments? Reach out on Slack: #support-infosec.
Hey @bsutton thanks for the PR! This seems reasonable to me. I'm heading out for the holiday but will look at getting this merged when I'm back.