Skip to content

Commit

Permalink
Fix styling with OpenRewrite.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Mar 5, 2024
1 parent 698ebeb commit 9456adf
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node
node_modules
target
*.iml
*.bak
.classpath
.project
.settings
Expand All @@ -11,4 +12,5 @@ release.properties
metrics.env
maven.log
.DS_Store
.idea
/package-lock.json
2 changes: 1 addition & 1 deletion doc/Continuous-Integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Eine solche Visualisierung ist unter GitHub Actions nicht verfügbar.
Da es für Jenkins keinen öffentlichen Service wie bei GitHub Actions gibt, um eigene Projekte zu bauen, muss die Jenkins
Integration lokal durchgeführt werden. Zur Vereinfachung des Jenkins Setup ist in diesem Coding Style eine
lauffähige Jenkins Installation enthalten (im Sinne von *Infrastructure as Code*).
Diese kann über `jenkins.sh` im Hauptverzeichnis gestartet werden. Anschließend wird die
Diese kann über `bin/jenkins.sh` gestartet werden. Anschließend wird die
aktuelle Jenkins LTS Version mit allen benötigten Plugins in einem Docker Container gebaut und gestartet (das dauert
beim ersten Aufruf etwas). Dazu wird ebenso ein als Docker Container initialisierter Java Agent (**Achtung**: Java 8)
verbunden, der die Builds ausführt.
Expand Down
32 changes: 32 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,15 @@
<maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
<maven-dependency-plugin.version>3.1.2</maven-dependency-plugin.version>
<depgraph-maven-plugin.version>4.0.3</depgraph-maven-plugin.version>
<sortpom-maven-plugin.version>3.4.0</sortpom-maven-plugin.version>

<!-- OpenRewrite versions -->
<rewrite-maven-plugin.version>5.23.3</rewrite-maven-plugin.version>
<rewrite-testing-frameworks.version>2.4.1</rewrite-testing-frameworks.version>
<sortpom-maven-plugin.version>3.4.0</sortpom-maven-plugin.version>
<rewrite-static-analysis.version>1.3.1</rewrite-static-analysis.version>
<rewrite-migrate-java.version>2.9.0</rewrite-migrate-java.version>
<rewrite-recommendations.version>1.2.2</rewrite-recommendations.version>

<!-- Maven Surefire ArgLine -->
<argLine>-Djava.util.logging.config.file=logging.properties</argLine>
Expand Down Expand Up @@ -297,6 +303,7 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
Expand Down Expand Up @@ -396,6 +403,7 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
Expand Down Expand Up @@ -760,6 +768,15 @@
<configuration>
<activeRecipes>
<recipe>org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertions</recipe>
<recipe>org.openrewrite.maven.BestPractices</recipe>
<recipe>org.openrewrite.staticanalysis.MissingOverrideAnnotation</recipe>
<recipe>org.openrewrite.staticanalysis.CommonStaticAnalysis</recipe>
<recipe>org.openrewrite.staticanalysis.RemoveExtraSemicolons</recipe>
<recipe>org.openrewrite.java.migrate.Java8toJava11</recipe>
<recipe>org.openrewrite.java.migrate.util.SequencedCollection</recipe>
<recipe>org.openrewrite.java.format.RemoveTrailingWhitespace</recipe>
<recipe>org.openrewrite.java.format.BlankLines</recipe>
<recipe>org.openrewrite.java.format.EmptyNewlineAtEndOfFile</recipe>
</activeRecipes>
</configuration>
<dependencies>
Expand All @@ -768,6 +785,21 @@
<artifactId>rewrite-testing-frameworks</artifactId>
<version>${rewrite-testing-frameworks.version}</version>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-static-analysis</artifactId>
<version>${rewrite-static-analysis.version}</version>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-migrate-java</artifactId>
<version>${rewrite-migrate-java.version}</version>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-recommendations</artifactId>
<version>${rewrite-recommendations.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/edu/hm/hafner/util/LineRange.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,3 @@ public String toString() {
return String.format("[%d-%d]", start, end);
}
}

2 changes: 1 addition & 1 deletion src/main/java/edu/hm/hafner/util/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
package edu.hm.hafner.util;

import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.NonNull;
2 changes: 1 addition & 1 deletion src/test/java/edu/hm/hafner/util/ArchitectureRules.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private static class ExceptionHasNoContext extends DescribedPredicate<JavaConstr
@Override
public boolean test(final JavaConstructorCall javaConstructorCall) {
ConstructorCallTarget target = javaConstructorCall.getTarget();
if (target.getRawParameterTypes().size() > 0) {
if (!target.getRawParameterTypes().isEmpty()) {
return false;
}
return target.getOwner().isAssignableTo(Throwable.class)
Expand Down

0 comments on commit 9456adf

Please sign in to comment.