Skip to content

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

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,29 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Maven cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup Maven cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'corretto'
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'corretto'

- name: Build with Maven
run: mvn -e --no-transfer-progress clean install
- name: Build with Maven
run: mvn -e --no-transfer-progress clean install

- name: Check for changes
shell: bash
run: |
git diff --exit-code || (
echo "::error::Code changes detected - run 'mvn clean verify' locally"
exit 1
)
25 changes: 25 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<rewrite.version>8.54.0</rewrite.version>
<rewrite.maven.plugin>6.11.0</rewrite.maven.plugin>
<recipe.bom.version>3.9.0</recipe.bom.version>
<junit.version>5.13.0</junit.version>
<assertj.version>3.24.2</assertj.version>
Expand Down Expand Up @@ -102,7 +103,31 @@
</configuration>
</plugin>

<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>${rewrite.maven.plugin}</version>
<configuration>
<activeRecipes>
<recipe>org.checkstyle.autofix.CheckstyleAutoFix</recipe>
</activeRecipes>
<recipeArtifactCoordinates>
<coordinate>org.checkstyle.autofix:checkstyle-openrewrite-recipes:1.0.0</coordinate>
</recipeArtifactCoordinates>
</configuration>
<executions>
<execution>
<id>checkstyle-autofix</id>
<phase>process-sources</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Checkstyle plugin for code style regulation -->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down