Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split codemod into two packages. #75

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Conversation

bsutton
Copy link

@bsutton bsutton commented Nov 17, 2023

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.

greenealexander and others added 11 commits October 20, 2023 18:23
…teractive

optionally interactive running of codemod
…demon package has exactly the same functionality as before except that the underlying ast traversal and creation of patches has been moved to codemon_core. The idea is that codemon_core can be used as an standalone API outside of the codemon CLI tooling.
Cleanup.
upgraded to latest version of analyzer.
Added option to ignore overlapping patches.
@aviary2-wf
Copy link

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.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@evanweible-wf
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants