Skip to content

Issue #18673: Organize openrewrite staticanalysis composite recipes by groups as it is done on openrewrite website#18798

Closed
Brijeshthummar02 wants to merge 1 commit into
checkstyle:masterfrom
Brijeshthummar02:rewrite
Closed

Issue #18673: Organize openrewrite staticanalysis composite recipes by groups as it is done on openrewrite website#18798
Brijeshthummar02 wants to merge 1 commit into
checkstyle:masterfrom
Brijeshthummar02:rewrite

Conversation

@Brijeshthummar02

Copy link
Copy Markdown
Contributor

Issue #18673

Continue of #18676

Restructured the static analysis recipes in rewrite.yml to follow the same grouping used on the OpenRewrite documentation:

  • Composite recipes (recipes that include further recipes): CodeCleanup, BufferedWriterCreationRecipes, SimplifyTernaryRecipes, URLEqualsHashCodeRecipes
  • Non-composite recipes: Individual recipes like InlineVariable, ModifierOrder, RemoveUnusedLocalVariables, etc.

@Pankraz76

Pankraz76 commented Jan 31, 2026

Copy link
Copy Markdown

kindly consider:

already extracted CommonStaticAnalysis and this should be the only one in order not to over do it.
we only need dedicated execution in CI but on in config file.

---
type: specs.openrewrite.org/v1beta/recipe
# workaround, as pom declaration not working...
name: org.checkstyle.AllAutoFixes
recipeList:
  - org.checkstyle.CheckstyleAutoFix
  - org.checkstyle.RefasterRules
  - org.checkstyle.StaticAnalysis
---
type: specs.openrewrite.org/v1beta/recipe
name: org.checkstyle.CheckstyleAutoFix
description: Checkstyle standard fixes.
recipeList:
  - org.checkstyle.autofix.CheckstyleAutoFix:
      violationReportPath: target/cs_errors.xml
      configurationPath: config/checkstyle-checks.xml
      propertiesPath: config/openrewrite-recipes-checkstyle.properties
---
type: specs.openrewrite.org/v1beta/recipe
name: org.checkstyle.RefasterRules
description: Picnic Refaster rules.
recipeList:
  - tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes
  - tech.picnic.errorprone.refasterrules.CharSequenceRulesRecipes
  - tech.picnic.errorprone.refasterrules.ClassRulesRecipes
  - tech.picnic.errorprone.refasterrules.CollectionRulesRecipes
  - tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes
  - tech.picnic.errorprone.refasterrules.FileRulesRecipes
  - tech.picnic.errorprone.refasterrules.MapRulesRecipes
  - tech.picnic.errorprone.refasterrules.MicrometerRulesRecipes
  - tech.picnic.errorprone.refasterrules.MockitoRulesRecipes
  # current maintainer don't "like" orElseThrow() as better form of get()
  # - tech.picnic.errorprone.refasterrules.OptionalRulesRecipes
  - tech.picnic.errorprone.refasterrules.PatternRulesRecipes
  - tech.picnic.errorprone.refasterrules.PreconditionsRulesRecipes
  - tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes
  - tech.picnic.errorprone.refasterrules.StreamRulesRecipes
  - tech.picnic.errorprone.refasterrules.TimeRulesRecipes
---
type: specs.openrewrite.org/v1beta/recipe
name: org.checkstyle.StaticAnalysis
description: OpenRewrite standard fixes.
recipeList:
  - org.checkstyle.CommonStaticAnalysis
  - org.openrewrite.java.RemoveUnusedImports
  - org.openrewrite.java.ShortenFullyQualifiedTypeReferences
  - org.openrewrite.java.SimplifySingleElementAnnotation
  - org.openrewrite.java.format.EmptyNewlineAtEndOfFile
  - org.openrewrite.java.format.NormalizeFormat
  - org.openrewrite.java.format.NormalizeLineBreaks
  - org.openrewrite.java.format.PadEmptyForLoopComponents
  - org.openrewrite.java.format.RemoveTrailingWhitespace
  - org.openrewrite.java.migrate.UpgradeToJava21
  - org.openrewrite.java.migrate.lang.StringRulesRecipes
  - org.openrewrite.java.migrate.util.MigrateInflaterDeflaterToClose
  - org.openrewrite.java.migrate.util.ReplaceStreamCollectWithToList
  - org.openrewrite.java.migrate.util.SequencedCollection
  - org.openrewrite.java.recipes.JavaRecipeBestPractices
  - org.openrewrite.java.recipes.RecipeTestingBestPractices
  - org.openrewrite.maven.BestPractices
  - org.openrewrite.staticanalysis.BufferedWriterCreationRecipes
  - org.openrewrite.staticanalysis.ForLoopControlVariablePostfixOperators
  - org.openrewrite.staticanalysis.HideUtilityClassConstructor
  - org.openrewrite.staticanalysis.JavaApiBestPractices
  - org.openrewrite.staticanalysis.LowercasePackage
  - org.openrewrite.staticanalysis.MissingOverrideAnnotation
  - org.openrewrite.staticanalysis.OperatorWrap
  - org.openrewrite.staticanalysis.RemoveUnusedLocalVariables
  - org.openrewrite.staticanalysis.RemoveUnusedPrivateFields
  - org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods
  - org.openrewrite.staticanalysis.ReplaceThreadRunWithThreadStart
  - org.openrewrite.staticanalysis.SimplifyTernaryRecipes
  - org.openrewrite.staticanalysis.TypecastParenPad
  - org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes
  - org.openrewrite.staticanalysis.UseLambdaForFunctionalInterface
---
type: specs.openrewrite.org/v1beta/recipe
name: org.checkstyle.CommonStaticAnalysis
recipeList:
  - org.openrewrite.staticanalysis.AbstractClassPublicConstructor
  - org.openrewrite.staticanalysis.AtomicPrimitiveEqualsUsesGet
  - org.openrewrite.staticanalysis.BigDecimalDoubleConstructorRecipe
  - org.openrewrite.staticanalysis.BigDecimalRoundingConstantsToEnums
  - org.openrewrite.staticanalysis.BooleanChecksNotInverted
  - org.openrewrite.staticanalysis.BufferedWriterCreationRecipes
  - org.openrewrite.staticanalysis.CaseInsensitiveComparisonsDoNotChangeCase
  - org.openrewrite.staticanalysis.CatchClauseOnlyRethrows
  - org.openrewrite.staticanalysis.ChainStringBuilderAppendCalls
  - org.openrewrite.staticanalysis.CollectionToArrayShouldHaveProperType
  - org.openrewrite.staticanalysis.CovariantEquals
  - org.openrewrite.staticanalysis.CustomImportOrder
  - org.openrewrite.staticanalysis.DefaultComesLast
  - org.openrewrite.staticanalysis.EmptyBlock
  - org.openrewrite.staticanalysis.EqualsAvoidsNull
  - org.openrewrite.staticanalysis.ExplicitInitialization
  - org.openrewrite.staticanalysis.ExternalizableHasNoArgsConstructor
  - org.openrewrite.staticanalysis.FinalizePrivateFields
  - org.openrewrite.staticanalysis.FallThrough
  - org.openrewrite.staticanalysis.FinalClass
  - org.openrewrite.staticanalysis.FixStringFormatExpressions
  - org.openrewrite.staticanalysis.ForLoopIncrementInUpdate
  - org.openrewrite.staticanalysis.IndexOfChecksShouldUseAStartPosition
  - org.openrewrite.staticanalysis.IndexOfReplaceableByContains
  - org.openrewrite.staticanalysis.IndexOfShouldNotCompareGreaterThanZero
  - org.openrewrite.staticanalysis.InlineVariable
  - org.openrewrite.staticanalysis.IsEmptyCallOnCollections
  - org.openrewrite.staticanalysis.LambdaBlockToExpression
  - org.openrewrite.staticanalysis.MethodNameCasing
  - org.openrewrite.staticanalysis.MinimumSwitchCases
  - org.openrewrite.staticanalysis.ModifierOrder
  - org.openrewrite.staticanalysis.MultipleVariableDeclarations
  - org.openrewrite.staticanalysis.NeedBraces
  - org.openrewrite.staticanalysis.NestedEnumsAreNotStatic
  - org.openrewrite.staticanalysis.NewStringBuilderBufferWithCharArgument
  - org.openrewrite.staticanalysis.NoDoubleBraceInitialization
  - org.openrewrite.staticanalysis.NoEmptyCollectionWithRawType
  - org.openrewrite.staticanalysis.NoEqualityInForCondition
  - org.openrewrite.staticanalysis.NoFinalizer
  - org.openrewrite.staticanalysis.NoPrimitiveWrappersForToStringOrCompareTo
  - org.openrewrite.staticanalysis.NoRedundantJumpStatements
  - org.openrewrite.staticanalysis.NoToStringOnStringType
  - org.openrewrite.staticanalysis.NoValueOfOnStringType
  - org.openrewrite.staticanalysis.ObjectFinalizeCallsSuper
  - org.openrewrite.staticanalysis.PreferSystemGetPropertyOverGetenv
  - org.openrewrite.staticanalysis.PrimitiveWrapperClassConstructorToValueOf
  - org.openrewrite.staticanalysis.RedundantFileCreation
  - org.openrewrite.staticanalysis.RemoveExtraSemicolons
  - org.openrewrite.staticanalysis.RemoveRedundantNullCheckBeforeInstanceof
  - org.openrewrite.staticanalysis.RemoveRedundantNullCheckBeforeLiteralEquals
  - org.openrewrite.staticanalysis.RenameMethodsNamedHashcodeEqualOrToString
  - org.openrewrite.staticanalysis.ReplaceClassIsInstanceWithInstanceof
  - org.openrewrite.staticanalysis.ReplaceLambdaWithMethodReference
  - org.openrewrite.staticanalysis.ReplaceStringBuilderWithString
  - org.openrewrite.staticanalysis.ReplaceStringConcatenationWithStringValueOf
  - org.openrewrite.staticanalysis.SimplifyArraysAsList
  - org.openrewrite.staticanalysis.SimplifyBooleanExpression
  - org.openrewrite.staticanalysis.SimplifyBooleanReturn
  - org.openrewrite.staticanalysis.StaticMethodNotFinal
  - org.openrewrite.staticanalysis.StringLiteralEquality
  - org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources
  - org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArguments
  - org.openrewrite.staticanalysis.UnnecessaryParentheses
  - org.openrewrite.staticanalysis.UnnecessaryPrimitiveAnnotations
  - org.openrewrite.staticanalysis.UnnecessaryReturnAsLastStatement
  - org.openrewrite.staticanalysis.UpperCaseLiteralSuffixes
  - org.openrewrite.staticanalysis.UseDiamondOperator
  - org.openrewrite.staticanalysis.UseJavaStyleArrayDeclarations
  - org.openrewrite.staticanalysis.UsePortableNewlines
  - org.openrewrite.staticanalysis.WhileInsteadOfFor
  - org.openrewrite.staticanalysis.WriteOctalValuesAsDecimal
  - org.openrewrite.kotlin.cleanup.EqualsMethodUsage
  - org.openrewrite.kotlin.cleanup.ImplicitParameterInLambda
  - org.openrewrite.kotlin.cleanup.ReplaceCharToIntWithCode
  - org.openrewrite.staticanalysis.CustomImportOrder

@romani

romani commented Feb 3, 2026

Copy link
Copy Markdown
Member

@Brijeshthummar02, please follow issue target, no distractions on other updates

@romani

romani commented Feb 11, 2026

Copy link
Copy Markdown
Member

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please organoze compisite recipes on top

Comment thread config/rewrite.yml Outdated
# Static analysis composite recipes (include further recipes)
- org.openrewrite.staticanalysis.BufferedWriterCreationRecipes
- org.openrewrite.staticanalysis.EqualsAvoidsNull
- org.openrewrite.staticanalysis.CodeCleanup

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

recipeList:
  # composite recipes   
  - org.checkstyle.autofix.CheckstyleAutoFix:
      violationReportPath: target/cs_errors.xml
      configurationPath: config/checkstyle-checks.xml
      propertiesPath: config/openrewrite-recipes-checkstyle.properties
  - org.openrewrite.staticanalysis.CodeCleanup
  # individual recipes
.....

@romani

romani commented Feb 11, 2026

Copy link
Copy Markdown
Member

@Brijeshthummar02, please never rebase in web.
Always single commit

@Brijeshthummar02

Brijeshthummar02 commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

@Brijeshthummar02, please never rebase in web. Always single commit

My bad, i forgot to fetch the latest changes and due to it got a merge conflict i lost track of entire changes and issue.

… recipes by groups as it is done on openrewrite website
@romani

romani commented Feb 17, 2026

Copy link
Copy Markdown
Member

@Brijeshthummar02 , please read #18673 (comment)

@romani romani closed this Feb 17, 2026
@Brijeshthummar02 Brijeshthummar02 deleted the rewrite branch March 4, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants