Skip to content

Commit 7292714

Browse files
committed
Issue #101: run bestPractices recipe with build
1 parent 85c5edb commit 7292714

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

pom.xml

Lines changed: 4 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,7 @@
173173
<version>${rewrite.maven.plugin}</version>
174174
<configuration>
175175
<activeRecipes>
176+
<recipe>org.checkstyle.recipes.OpenRewriteRecipeBestPractices</recipe>
176177
<recipe>CheckstyleAutoFixConfigured</recipe>
177178
</activeRecipes>
178179
<exclusions>
@@ -188,7 +189,7 @@
188189
<dependency>
189190
<groupId>org.openrewrite.recipe</groupId>
190191
<artifactId>rewrite-rewrite</artifactId>
191-
<version>RELEASE</version>
192+
<version>0.12.1</version>
192193
</dependency>
193194
</dependencies>
194195
<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)