Skip to content

Commit edacbaf

Browse files
author
Vincent Potucek
committed
PoC: Add rewrite support for errorprone.refasterrules
1 parent e1f4521 commit edacbaf

File tree

58 files changed

+3804
-947
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3804
-947
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
uses: actions/checkout@v4
122122
with:
123123
persist-credentials: false
124-
ref: ${{ github.sha }} # this is the default, just being explicit.
124+
ref: ${{ github.sha }} # this is the default, just being explicit.
125125
- name: Setup Python
126126
uses: ./.github/actions/setup-python
127127
- name: Setup Gradle
@@ -140,7 +140,7 @@ jobs:
140140
# --scan: Publish the build scan. This will only work on PRs from apache/kafka and trunk
141141
# --no-scan: For public fork PRs, we won't attempt to publish the scan
142142
run: |
143-
./gradlew --build-cache --info $SCAN_ARG check releaseTarGz -x test
143+
./gradlew check rewriteDryRun --build-cache --info $SCAN_ARG releaseTarGz -x test
144144
- name: Archive check reports
145145
if: always()
146146
uses: actions/upload-artifact@v4

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,17 @@ For experiments (or regression testing purposes) add `-PcheckstyleVersion=X.y.z`
201201
#### Spotless ####
202202
The import order is a part of static check. please call `spotlessApply` to optimize the imports of Java codes before filing pull request.
203203

204-
./gradlew spotlessApply
204+
`./gradlew spotlessApply`
205+
206+
#### Rewrite
207+
The build system incorporates [Moderne](https://moderne.io/) rewrite capabilities for automated code transformations.
208+
209+
- **Convention** (e.g., JUnit's naming rules)
210+
- **Refactor** safely (e.g., rename methods, migrate APIs)
211+
- **Modernize** (e.g., Java 8 → Java 17 features)
212+
- **Patterns** (e.g., replace `Vector` with `ArrayList`)
213+
214+
`./gradlew rewriteRun`
205215

206216
#### Spotbugs ####
207217
Spotbugs uses static analysis to look for bugs in the code.

0 commit comments

Comments
 (0)