Skip to content

Commit

Permalink
Recipe descriptions should end in a dot (#311)
Browse files Browse the repository at this point in the history
* Recipe descriptions should end in a dot

* Correctly detect empty recipe
  • Loading branch information
timtebeek authored Jul 24, 2024
1 parent 749dcd0 commit c68eb4e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ private List<NamedStyles> getStyles() {
protected ResultsContainer listResults(ExecutionContext ctx) {
Environment env = environment();
Recipe recipe = env.activateRecipes(getActiveRecipes());
if (recipe.getRecipeList().isEmpty()) {
if (recipe.getName().equals("org.openrewrite.Recipe$Noop")) {
logger.warn("No recipes were activated. Activate a recipe with rewrite.activeRecipe(\"com.fully.qualified.RecipeClassName\") in your build file, or on the command line with -DactiveRecipe=com.fully.qualified.RecipeClassName");
return new ResultsContainer(baseDir, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class RewriteDryRunTest : RewritePluginTest {
rewriteYaml("""
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.gradle.SayHello
description: Test.
recipeList:
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.openrewrite.before.HelloWorld sayGoodbye()
Expand Down
13 changes: 7 additions & 6 deletions plugin/src/test/kotlin/org/openrewrite/gradle/RewriteRunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ class RewriteRunTest : RewritePluginTest {
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.test.RemoveJacksonCore
displayName: Remove jackson-core
description: Remove jackson-core
description: Remove jackson-core.
recipeList:
- org.openrewrite.gradle.RemoveDependency:
groupId: com.fasterxml.jackson.core
Expand Down Expand Up @@ -669,7 +669,7 @@ class RewriteRunTest : RewritePluginTest {
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.test.UpgradeJacksonCore
displayName: Remove jackson-core
description: Remove jackson-core
description: Remove jackson-core.
recipeList:
- org.openrewrite.gradle.UpgradeDependencyVersion:
groupId: com.fasterxml.jackson.core
Expand Down Expand Up @@ -877,7 +877,7 @@ class RewriteRunTest : RewritePluginTest {
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.test.FindA
displayName: Rename build.gradle to build.gradle.kts
description: Rename build.gradle to build.gradle.kts
description: Rename build.gradle to build.gradle.kts.
recipeList:
- org.openrewrite.java.search.FindTypes:
fullyQualifiedTypeName: com.foo.A
Expand Down Expand Up @@ -1096,7 +1096,7 @@ class RewriteRunTest : RewritePluginTest {
type: specs.openrewrite.org/v1beta/recipe
name: com.example.TextToSam
displayName: Changes contents of sam.txt
description: Change contents of sam.txt to "sam"
description: Change contents of sam.txt to "sam".
preconditions:
- org.openrewrite.FindSourceFiles:
filePattern: "**/sam.txt"
Expand Down Expand Up @@ -1152,7 +1152,7 @@ class RewriteRunTest : RewritePluginTest {
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.Overlaps
displayName: Find overlaps
description: Find lombok SneakyThrows annotation and duplicate source files
description: Find lombok SneakyThrows annotation and duplicate source files.
recipeList:
- org.openrewrite.java.search.FindTypes:
fullyQualifiedTypeName: lombok.SneakyThrows
Expand Down Expand Up @@ -1250,7 +1250,7 @@ class RewriteRunTest : RewritePluginTest {
type: specs.openrewrite.org/v1beta/recipe
name: com.test.DeleteYamlKey
displayName: Delete yaml
description: Delete yaml
description: Delete yaml.
recipeList:
- org.openrewrite.DeleteSourceFiles:
filePattern: "**/foo.yml"
Expand Down Expand Up @@ -1320,6 +1320,7 @@ class RewriteRunTest : RewritePluginTest {
rewriteYaml("""
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.gradle.FindDistributionUrl
description: Test.
recipeList:
- org.openrewrite.properties.search.FindProperties:
propertyKey: distributionUrl
Expand Down

0 comments on commit c68eb4e

Please sign in to comment.