Skip to content

Commit

Permalink
Do not run RemoveUnusedPrivateFields on pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Dec 16, 2024
1 parent 38dc870 commit a8568fd
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/receive-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ concurrency:
# Since this pull request receives untrusted code, we should **NOT** have any secrets in the environment.
jobs:
upload-patch:
uses: openrewrite/gh-automation/.github/workflows/receive-pr.yml@main
uses: openrewrite/gh-automation/.github/workflows/receive-pr.yml@main
with:
recipe: 'org.openrewrite.recipes.OpenRewriteBestPracticesSubset'
95 changes: 95 additions & 0 deletions rewrite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#
# Copyright 2024 the original author or authors.
# <p>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# <p>
# https://www.apache.org/licenses/LICENSE-2.0
# <p>
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.recipes.OpenRewriteBestPracticesSubset
displayName: OpenRewrite best practices
description: Best practices for OpenRewrite recipe development.
recipeList:
- org.openrewrite.recipes.JavaRecipeBestPractices
- org.openrewrite.recipes.RecipeTestingBestPractices
- org.openrewrite.recipes.RecipeNullabilityBestPractices
- org.openrewrite.java.OrderImports
- org.openrewrite.java.RemoveUnusedImports
- org.openrewrite.java.format.EmptyNewlineAtEndOfFile
- org.openrewrite.java.format.RemoveTrailingWhitespace
- org.openrewrite.staticanalysis.InlineVariable
- org.openrewrite.staticanalysis.LambdaBlockToExpression
- org.openrewrite.staticanalysis.MissingOverrideAnnotation
- org.openrewrite.staticanalysis.OperatorWrap:
wrapOption: EOL
- org.openrewrite.staticanalysis.RemoveUnusedLocalVariables
#- org.openrewrite.staticanalysis.RemoveUnusedPrivateFields
- org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods
#- org.openrewrite.staticanalysis.UnnecessaryThrows
- org.openrewrite.staticanalysis.UseDiamondOperator
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.recipes.JavaRecipeBestPractices
displayName: Java Recipe best practices
description: Best practices for Java recipe development.
preconditions:
- org.openrewrite.java.search.FindTypes:
fullyQualifiedTypeName: org.openrewrite.Recipe
checkAssignability: true
recipeList:
- org.openrewrite.java.recipes.BlankLinesAroundFieldsWithAnnotations
- org.openrewrite.java.recipes.ExecutionContextParameterName
- org.openrewrite.java.recipes.MissingOptionExample
- org.openrewrite.java.recipes.NoMutableStaticFieldsInRecipes
- org.openrewrite.java.recipes.RecipeEqualsAndHashCodeCallSuper
- org.openrewrite.java.recipes.UseTreeRandomId
- org.openrewrite.staticanalysis.NeedBraces
- org.openrewrite.staticanalysis.RemoveSystemOutPrintln
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: '@org.openrewrite.NlsRewrite.DisplayName'
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: '@org.openrewrite.NlsRewrite.Description'
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.recipes.RecipeTestingBestPractices
displayName: Recipe testing best practices
description: Best practices for testing recipes.
preconditions:
- org.openrewrite.java.search.FindTypes:
fullyQualifiedTypeName: org.openrewrite.test.RewriteTest
checkAssignability: true
recipeList:
- org.openrewrite.java.recipes.RewriteTestClassesShouldNotBePublic
- org.openrewrite.java.recipes.SelectRecipeExamples
- org.openrewrite.java.recipes.SourceSpecTextBlockIndentation
- org.openrewrite.java.testing.cleanup.RemoveTestPrefix
- org.openrewrite.java.testing.cleanup.TestsShouldNotBePublic
- org.openrewrite.staticanalysis.NeedBraces
- org.openrewrite.staticanalysis.RemoveSystemOutPrintln
- org.openrewrite.java.UseStaticImport:
methodPattern: 'org.openrewrite..Assertions *(..)'
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.recipes.RecipeNullabilityBestPractices
displayName: Recipe nullability best practices
description: Use JSpecify nullable annotations; drop Nonnull annotations; use `NullMarked` on `package-info.java` instead.
recipeList:
- org.openrewrite.java.jspecify.MigrateFromOpenRewriteAnnotations
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: '@org.jetbrains.annotations.NotNull'
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: '@javax.annotation.Nonnull'
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: '@jakarta.annotation.Nonnull'
- org.openrewrite.java.jspecify.MigrateToJspecify
- org.openrewrite.staticanalysis.AnnotateNullableMethods
- org.openrewrite.staticanalysis.NullableOnMethodReturnType

0 comments on commit a8568fd

Please sign in to comment.