Skip to content

Commit 137c70c

Browse files
committed
Implemented Auto-fix on project source
1 parent 5bece85 commit 137c70c

File tree

2 files changed

+46
-15
lines changed

2 files changed

+46
-15
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,28 @@ jobs:
1414
runs-on: ${{ matrix.platform }}
1515

1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v4
1818

19-
- name: Setup Maven cache
20-
uses: actions/cache@v4
21-
with:
22-
path: ~/.m2/repository
23-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
24-
restore-keys: |
25-
${{ runner.os }}-maven-
19+
- name: Setup Maven cache
20+
uses: actions/cache@v4
21+
with:
22+
path: ~/.m2/repository
23+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
24+
restore-keys: |
25+
${{ runner.os }}-maven-
2626
27-
- name: Set up JDK 11
28-
uses: actions/setup-java@v4
29-
with:
30-
java-version: '11'
31-
distribution: 'corretto'
27+
- name: Set up JDK 11
28+
uses: actions/setup-java@v4
29+
with:
30+
java-version: '11'
31+
distribution: 'corretto'
3232

33-
- name: Build with Maven
34-
run: mvn -e --no-transfer-progress clean install
33+
- name: Build with Maven
34+
run: mvn -e --no-transfer-progress clean install
35+
36+
- name: Check for changes
37+
run: |
38+
git diff --exit-code || (
39+
echo "Code changes detected - run 'mvn clean verify' locally"
40+
exit 1
41+
)

pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,31 @@
102102
</configuration>
103103
</plugin>
104104

105+
<plugin>
106+
<groupId>org.openrewrite.maven</groupId>
107+
<artifactId>rewrite-maven-plugin</artifactId>
108+
<version>6.11.0</version>
109+
<configuration>
110+
<activeRecipes>
111+
<recipe>org.checkstyle.autofix.CheckstyleAutoFix</recipe>
112+
</activeRecipes>
113+
<recipeArtifactCoordinates>
114+
<coordinate>org.checkstyle.autofix:checkstyle-openrewrite-recipes:1.0.0</coordinate>
115+
</recipeArtifactCoordinates>
116+
</configuration>
117+
<executions>
118+
<execution>
119+
<id>checkstyle-autofix</id>
120+
<phase>process-sources</phase>
121+
<goals>
122+
<goal>run</goal>
123+
</goals>
124+
</execution>
125+
</executions>
126+
</plugin>
127+
105128
<!-- Checkstyle plugin for code style regulation -->
129+
106130
<plugin>
107131
<groupId>org.apache.maven.plugins</groupId>
108132
<artifactId>maven-checkstyle-plugin</artifactId>

0 commit comments

Comments
 (0)