Skip to content

Commit 2269819

Browse files
author
Vincent Potucek
committed
org.openrewrite.maven.BestPractices
1 parent 8d0b1e4 commit 2269819

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

pmd.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="DefinitionOfDone"
3+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.net/ruleset_2_0_0.xsd">
6+
<description>DefinitionOfDone</description>
7+
<exclude-pattern>.*/Multisets.java</exclude-pattern><!--https://github.com/pmd/pmd/issues/6028-->
8+
<exclude-pattern>.*/com/google/common/reflect/A*.*</exclude-pattern>
9+
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"/>
10+
<!--<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashCodeOnComparable" />-->
11+
<!--<rule ref="category/java/codestyle.xml/UnnecessaryImport" /> https://github.com/pmd/pmd/issues/6027 -->
12+
<!--<rule ref="category/java/bestpractices.xml/ModifierOrder"/> https://github.com/pmd/pmd/issues/6019 -->
13+
</ruleset>

pom.xml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,69 @@
130130
</execution>
131131
</executions>
132132
</plugin>
133+
<plugin>
134+
<groupId>org.apache.maven.plugins</groupId>
135+
<artifactId>maven-pmd-plugin</artifactId>
136+
</plugin>
137+
<plugin>
138+
<groupId>org.openrewrite.maven</groupId>
139+
<artifactId>rewrite-maven-plugin</artifactId>
140+
</plugin>
133141
</plugins>
134142
<pluginManagement>
135143
<plugins>
144+
<plugin>
145+
<groupId>org.apache.maven.plugins</groupId>
146+
<artifactId>maven-pmd-plugin</artifactId>
147+
<version>3.27.0</version>
148+
<configuration>
149+
<analysisCache>true</analysisCache>
150+
<failOnViolation>true</failOnViolation>
151+
<includeTests>true</includeTests>
152+
<printFailingErrors>true</printFailingErrors>
153+
<rulesets>
154+
<ruleset>pmd.xml</ruleset>
155+
</rulesets>
156+
</configuration>
157+
<executions>
158+
<execution>
159+
<phase>verify</phase>
160+
<goals>
161+
<goal>check</goal>
162+
</goals>
163+
</execution>
164+
</executions>
165+
</plugin>
166+
<plugin>
167+
<groupId>org.openrewrite.maven</groupId>
168+
<artifactId>rewrite-maven-plugin</artifactId>
169+
<version>6.15.0</version>
170+
<configuration>
171+
<activeRecipes>
172+
<recipe>DefinitionOfDone</recipe>
173+
</activeRecipes>
174+
<exclusions>
175+
<exclusion>package-info.java</exclusion>
176+
</exclusions>
177+
<exportDatatables>true</exportDatatables>
178+
<failOnDryRunResults>true</failOnDryRunResults>
179+
</configuration>
180+
<executions>
181+
<execution>
182+
<phase>verify</phase>
183+
<goals>
184+
<goal>dryRun</goal>
185+
</goals>
186+
</execution>
187+
</executions>
188+
<dependencies>
189+
<dependency>
190+
<groupId>org.openrewrite.recipe</groupId>
191+
<artifactId>rewrite-static-analysis</artifactId>
192+
<version>2.16.0</version>
193+
</dependency>
194+
</dependencies>
195+
</plugin>
136196
<plugin>
137197
<artifactId>maven-antrun-plugin</artifactId>
138198
<version>1.6</version>

rewrite.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
type: specs.openrewrite.org/v1beta/recipe
2+
name: DefinitionOfDone
3+
displayName: Definition of Done
4+
description: Automatically cleanup code to comply checkstyle convention.
5+
recipeList:
6+
- org.openrewrite.maven.BestPractices

0 commit comments

Comments
 (0)