Skip to content

Commit f50d2df

Browse files
Anmol202005rdiachenko
authored andcommitted
Issue #101: run bestPractices recipe with build
1 parent 85c5edb commit f50d2df

File tree

5 files changed

+11
-130
lines changed

5 files changed

+11
-130
lines changed

.github/workflows/comment-pr.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.github/workflows/receive-pr.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

pom.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<maven.compiler.plugin>3.11.0</maven.compiler.plugin>
2121
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2222

23-
<rewrite.maven.plugin>6.16.0</rewrite.maven.plugin>
24-
<recipe.bom.version>3.13.0</recipe.bom.version>
23+
<rewrite.maven.plugin>6.17.0</rewrite.maven.plugin>
24+
<recipe.bom.version>3.14.0</recipe.bom.version>
2525
<junit.version>5.13.4</junit.version>
2626
<assertj.version>3.27.4</assertj.version>
2727

@@ -173,6 +173,9 @@
173173
<version>${rewrite.maven.plugin}</version>
174174
<configuration>
175175
<activeRecipes>
176+
<recipe>org.checkstyle.recipes.OpenRewriteRecipeBestPractices</recipe>
177+
<recipe>org.checkstyle.recipes.JavaRecipeBestPractices</recipe>
178+
<recipe>org.checkstyle.recipes.RecipeTestingBestPracticesSubset</recipe>
176179
<recipe>CheckstyleAutoFixConfigured</recipe>
177180
</activeRecipes>
178181
<exclusions>
@@ -188,7 +191,7 @@
188191
<dependency>
189192
<groupId>org.openrewrite.recipe</groupId>
190193
<artifactId>rewrite-rewrite</artifactId>
191-
<version>RELEASE</version>
194+
<version>0.12.1</version>
192195
</dependency>
193196
</dependencies>
194197
<executions>

rewrite.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,14 @@ preconditions:
4444
recipeList:
4545
- org.openrewrite.java.recipes.BlankLinesAroundFieldsWithAnnotations
4646
- org.openrewrite.java.recipes.CorrectlySpacedDescriptions
47-
# - org.openrewrite.java.recipes.ExecutionContextParameterName
47+
- org.openrewrite.java.recipes.ExecutionContextParameterName:
48+
parameterName: executionContext
4849
- org.openrewrite.java.recipes.IsLiteralNullRecipe
4950
- org.openrewrite.java.recipes.MissingOptionExample
5051
- org.openrewrite.java.recipes.NoMutableStaticFieldsInRecipes
5152
- org.openrewrite.java.recipes.RecipeEqualsAndHashCodeCallSuper
5253
- org.openrewrite.java.recipes.UseTreeRandomId
53-
- org.openrewrite.java.recipes.migrate.RemoveTraitsUsageRecipes
54+
- org.openrewrite.java.InlineMethodCalls
5455
- org.openrewrite.staticanalysis.NeedBraces
5556
- org.openrewrite.staticanalysis.RemoveSystemOutPrintln
5657
- org.openrewrite.java.RemoveAnnotation:

src/main/java/org/checkstyle/autofix/recipe/RedundantImport.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ private final class RemoveRedundantImportsVisitor extends JavaIsoVisitor<Executi
6060
private Path sourcePath;
6161

6262
@Override
63-
public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext ctx) {
63+
public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu,
64+
ExecutionContext executionContext) {
6465

6566
this.sourcePath = cu.getSourcePath().toAbsolutePath();
6667

0 commit comments

Comments
 (0)