-
Notifications
You must be signed in to change notification settings - Fork 2
Implemented Auto-fix on project source #13
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And one more quick question: have you tried running this updated CI? Is there a link to the executed CI jobs so we can confirm that it does exactly what we expect?
.github/workflows/ci.yml
Outdated
run: | | ||
git diff --exit-code || ( | ||
echo "Code changes detected - run 'mvn clean verify' locally" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess it is a good place to use GitHub Actions error annotation (::error::), so it can be highlighted in UI
echo "::error::Code changes detected - run 'mvn clean verify' locally"
Code changes detected - run 'mvn clean verify' locally
btw I've never tried it before :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
pom.xml
Outdated
<plugin> | ||
<groupId>org.openrewrite.maven</groupId> | ||
<artifactId>rewrite-maven-plugin</artifactId> | ||
<version>6.11.0</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we store it as a property and refer to the value here?
similar to https://github.com/checkstyle/checkstyle/blob/91f3e70c6f7d6bd8f3a0a2b4a8dcdf6ca3a582fb/pom.xml#L204
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
LGTM, when building the project <<< rewrite:6.11.0:run (checkstyle-autofix) < process-test-classes @ checkstyle-openrewrite-recipes <<<
[INFO]
[INFO]
[INFO] --- rewrite:6.11.0:run (checkstyle-autofix) @ checkstyle-openrewrite-recipes ---
[INFO] Using active recipe(s) [org.checkstyle.autofix.CheckstyleAutoFix]
[INFO] Using active styles(s) []
[INFO] Validating active recipes...
[INFO] Project [checkstyle openrewrite recipes] Resolving Poms...
[INFO] Project [checkstyle openrewrite recipes] Parsing source files
[INFO] Running recipe(s)... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was talking about this one https://github.com/checkstyle/checkstyle-openrewrite-recipes/actions/runs/15568305920/job/43837732096
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Fixes: #12
Configured the OpenRewrite plugin to run automatically during the Maven build lifecycle, so code fixes will be applied during project builds.
Additionally, implemented Git diff logic in
ci.yml
to flag changes detected viagit diff
.