Skip to content

Updated IgnoredPatterns & Added support for more Rewrite recipes #977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
99 changes: 75 additions & 24 deletions sbm-support-rewrite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot.version>3.1.3</spring-boot.version>
<rewrite.version>8.5.1</rewrite.version>
<rewrite-recipe.version>2.3.0</rewrite-recipe.version>
<rewrite-maven-plugin.version>5.3.2</rewrite-maven-plugin.version>
<maven.version>3.9.1</maven.version>
<maven-resolver.version>1.9.13</maven-resolver.version>
Expand Down Expand Up @@ -88,6 +89,20 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-bom</artifactId>
<version>${rewrite.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-recipe-bom</artifactId>
<version>${rewrite-recipe.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -107,48 +122,93 @@
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-maven</artifactId>
<version>${rewrite.version}</version>
<artifactId>rewrite-gradle</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-java</artifactId>
<version>${rewrite.version}</version>
<artifactId>rewrite-groovy</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-java-17</artifactId>
<version>${rewrite.version}</version>
<artifactId>rewrite-hcl</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-java</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-java-dependencies</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-json</artifactId>
<version>${rewrite.version}</version>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-yaml</artifactId>
<version>${rewrite.version}</version>
<artifactId>rewrite-maven</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-hcl</artifactId>
<version>${rewrite.version}</version>
<artifactId>rewrite-properties</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-protobuf</artifactId>
<version>${rewrite.version}</version>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-xml</artifactId>
<version>${rewrite.version}</version>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-properties</artifactId>
<version>${rewrite.version}</version>
<artifactId>rewrite-yaml</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-cucumber-jvm</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-hibernate</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-java-security</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-logging-frameworks</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-micrometer</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-migrate-java</artifactId>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove the "recipe" jars again?
They should not be part of the parser component by default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @fabapp2. The reason the add them was so that we don't need to manage it it in core or the app where the sdk is being used ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do u want me to remove the recipe bom too ?

<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-spring</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-sql</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-static-analysis</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-testing-frameworks</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>${rewrite-maven-plugin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
Expand Down Expand Up @@ -183,13 +243,6 @@
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>

<dependency>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>${rewrite-maven-plugin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
Expand Down Expand Up @@ -274,7 +327,6 @@
</dependency>
<!-- END: Required by PrivateArtifactRepositoryTest -->
</dependencies>

<build>
<pluginManagement>
<plugins>
Expand All @@ -295,7 +347,6 @@
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ public class ParserProperties {
/**
* Comma-separated list of patterns used to create PathMatcher to exclude paths from being parsed.
*/
private Set<String> ignoredPathPatterns = Set.of("**/target/**", "target/**", "**/.idea/**", ".idea/**", ".mvn/**", "**/.mvn/**");
private Set<String> ignoredPathPatterns = Set.of("**/target/**", "target/**", "**/.idea/**", ".idea/**", "**/.git/**", ".git/**", ".mvn/**", "**/.mvn/**", "node_modules/**", "**/node_modules/**");

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ parser.sizeThresholdMb=10
parser.runPerSubmodule=false
parser.failOnInvalidActiveRecipes=true
parser.activeProfiles=default
parser.ignoredPathPatterns=**.idea/**,**.git/**,**/target/**,target/**
parser.ignoredPathPatterns=**/.idea/**,.idea/**,**/.git/**,.git/**,**/.mvn/**,.mvn/**,**/target/**,target/**,**/node_modules/**,node_modules/**
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void defaultActiveProfiles() {
@Test
@DisplayName("parser.ignoredPathPatterns")
void defaultIgnoredPathPatterns() {
assertThat(parserProperties.getIgnoredPathPatterns()).containsExactlyInAnyOrder("**.idea/**", "**.git/**", "**/target/**", "target/**");
assertThat(parserProperties.getIgnoredPathPatterns()).containsExactlyInAnyOrder("**/target/**", "target/**", "**/.idea/**", ".idea/**", "**/.git/**", ".git/**", ".mvn/**", "**/.mvn/**", "node_modules/**", "**/node_modules/**");
}

}
Expand Down