Skip to content

Commit

Permalink
Fix links to rewrite-java-test and rewrite-protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Oct 15, 2024
1 parent f8007e3 commit 71ff899
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/main/kotlin/org/openrewrite/RecipeOrigin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ class RecipeOrigin(
fun isFromCoreLibrary() = groupId == "org.openrewrite" && coreLibs.contains(artifactId)

private fun convertNameToJavaPath(recipeName: String): String =
recipeName.replace('.', '/').replace(Regex("Recipes?\\$?.*"), "") + ".java"
recipeName
.replace('.', '/')
.replace(Regex("Recipes?\\$?.*"), "") + ".java"

fun githubUrl(): String {
return if (isFromCoreLibrary()) {
Expand Down Expand Up @@ -59,7 +61,18 @@ class RecipeOrigin(
companion object {
private val parsePattern = Pattern.compile("([^:]+):([^:]+):([^:]+):(.+)")
private val coreLibs = setOf(
"rewrite-core", "rewrite-gradle", "rewrite-groovy", "rewrite-hcl", "rewrite-java", "rewrite-json", "rewrite-maven", "rewrite-properties", "rewrite-xml", "rewrite-yaml"
"rewrite-core",
"rewrite-gradle",
"rewrite-groovy",
"rewrite-hcl",
"rewrite-java",
"rewrite-java-test",
"rewrite-json",
"rewrite-maven",
"rewrite-properties",
"rewrite-protobuf",
"rewrite-xml",
"rewrite-yaml"
)

fun fromString(encoded: String): RecipeOrigin {
Expand Down

0 comments on commit 71ff899

Please sign in to comment.