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

Add codemodder framework and replace 1 codemod #24

Merged
merged 19 commits into from
Mar 14, 2023
Merged

Conversation

nahsra
Copy link
Contributor

@nahsra nahsra commented Mar 12, 2023

This PR adds a new codemodder framework, including an example provider, and a single codemod replacing the old way of doing things.

@nahsra nahsra self-assigned this Mar 12, 2023
@@ -16,9 +15,6 @@ public interface FileWeavingContext {

boolean madeWeaves();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took out this tight coupling to JavaParser as this class is intended to be used generally.

@nahsra nahsra requested a review from gilday March 12, 2023 17:46
@nahsra nahsra marked this pull request as ready for review March 12, 2023 17:46
@nahsra nahsra requested a review from gilday March 14, 2023 12:56
Copy link
Collaborator

@gilday gilday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I focused my review on the framework and mostly skipped over changes to existing codetl stuff.

id("io.openpixee.codetl.base")
id("io.openpixee.codetl.java-library")
id("io.openpixee.codetl.maven-publish")
id("application")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unusual to have the application and java-library plugins in a project. Do we need the application plugin? I understand this is a library.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand these so I just copied them all from the root to every new project. 😓

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • io.openpixee.codetl.base is our conventions on top of Gradle's base plugin. It defines things constant to all buildscripts like buildscript formatting. It's usually implied by other plugins e.g. java-library: I can't recall if that's the case here.
  • io.openpixee.codetl.java-library is our conventions on top of Gradle's java library plugin. It's used to define a library used by other Java projects.
  • application is Gradle's application plugin. We don't have conventions for this one, I don't think we use it I can't remember.
  • io.openpixee.codetl.maven-publish is our conventions on top of Gradle's maven publish plugin. It's for publishing artifacts to a Maven repository. We only include it if we need to publish the artifact to a Maven repository.

}
}

spotless {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't doing anything

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I can delete all the spotless kotlins from the new projects?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, the formatting is being applied by the plugins at the top of this build script.

languages/codemodder-default-codemods/build.gradle.kts Outdated Show resolved Hide resolved
languages/java/build.gradle.kts Show resolved Hide resolved
@nahsra nahsra merged commit a1d7c22 into main Mar 14, 2023
@nahsra nahsra deleted the add_codemodder_framework branch March 14, 2023 21:47
ryandens pushed a commit that referenced this pull request Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants