Skip to content

Issue #18673: organised recipes#18791

Closed
Anushreebasics wants to merge 1 commit intocheckstyle:masterfrom
Anushreebasics:openrewrite
Closed

Issue #18673: organised recipes#18791
Anushreebasics wants to merge 1 commit intocheckstyle:masterfrom
Anushreebasics:openrewrite

Conversation

@Anushreebasics
Copy link
Copy Markdown
Contributor

Issue #18673
fixes #18673

Summary:

Grouped and organized the OpenRewrite recipes by:

  • Adding a section for composite recipes (e.g., CheckstyleAutoFix, CommonStaticAnalysis).
  • Separating individual recipes and grouping them after the composite ones.

Moved the tech.picnic.errorprone.refasterrules recipes out of the static analysis composite group and listed them individually.

Added comments to clarify composite and individual recipe sections.

Reformatted the YAML for clarity and maintainability (e.g., multi-line description, section headers).

Removed duplicate and misplaced recipes from the static analysis composite group.

These changes align the file structure and grouping with the OpenRewrite website. No logic or recipe content was changed—only the grouping, order, and formatting.

@romani please review

@Anushreebasics Anushreebasics force-pushed the openrewrite branch 2 times, most recently from cda343e to 5787beb Compare January 29, 2026 14:40
Comment thread config/rewrite.yml Outdated
- tech.picnic.errorprone.refasterrules.StreamRulesRecipes
- tech.picnic.errorprone.refasterrules.TimeRulesRecipes
---

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change

@Pankraz76
Copy link
Copy Markdown

kindly consider to pull this afterwards:

@Anushreebasics
Copy link
Copy Markdown
Contributor Author

@Pankraz76 why have you changed other files apart from rewrite.yml?

@Anushreebasics Anushreebasics force-pushed the openrewrite branch 2 times, most recently from 13b3282 to c10440b Compare January 29, 2026 16:56
Copy link
Copy Markdown
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

Comment thread config/rewrite.yml Outdated
@Pankraz76
Copy link
Copy Markdown

@Pankraz76 why have you changed other files apart from rewrite.yml?

because i have added all the recipes it seems you just doing a reorg.

@romani
Copy link
Copy Markdown
Member

romani commented Jan 30, 2026

@Anushreebasics , please resovle conflict, we did split.
but your update still required.

@Pankraz76
Copy link
Copy Markdown

Pankraz76 commented Jan 30, 2026

how can the pipeline be red? you trying to patch but actually you just mimic the dryRun feature of rewrite but going for the feature envy reimplementing rewrite. This makes no sense and is not how its supposed to be done @romani

as seen here....

@romani
Copy link
Copy Markdown
Member

romani commented Jan 30, 2026

@Anushreebasics , can you please always have single commit in PRs.
Always, always squash all in one commit.

@Pankraz76
Copy link
Copy Markdown

Always, always squash all in one commit.

had same idea. you can squash merge as well. consider adding the squash hint to readme. also then add simple CI job to fail CI if more then 1 commit in total right, like the no merge commits stuff count == 1 is very simple condition to check and fail.

@Pankraz76
Copy link
Copy Markdown

git reset --soft $(git merge-base master HEAD)

Copy link
Copy Markdown
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

items:

Comment thread config/rewrite.yml Outdated
Comment on lines +20 to +22
- org.openrewrite.staticanalysis.CommonStaticAnalysis
# individual recipes
- org.openrewrite.staticanalysis.CommonStaticAnalysis
Copy link
Copy Markdown
Member

@romani romani Jan 30, 2026

Choose a reason for hiding this comment

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

???
remove from individual

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread config/rewrite.yml Outdated
# - org.openrewrite.staticanalysis.ChainStringBuilderAppendCalls
# - org.openrewrite.staticanalysis.ClassUnnecessaryModifier
# - org.openrewrite.staticanalysis.CloseResource
# - org.openrewrite.staticanalysis.CommonStaticAnalysis
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.

???? there is not such

and no CloseResource.

just copy

Image paste and comment out what was not activated before to avoid violations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread config/rewrite.yml Outdated
description: |
Resolve common static analysis issues (also known as SAST issues).
recipeList:
# The following recipes are available but not currently enabled. Uncomment to enable as needed.
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 create new issue and put in comment "until #xxxx "
we will investigate each rules separately to make decision on permanent suppression or actually apply.

@Pankraz76
Copy link
Copy Markdown

kindly consider enabler:

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Reorganizes the OpenRewrite recipe catalog/configuration to group composite recipes separately from individual recipes and aligns sections with the OpenRewrite static analysis recipe listing.

Changes:

  • Restructured config/rewrite.yml recipe groupings (composite vs individual), added section comments, and reformatted descriptions.
  • Added SAST to the spellchecker whitelist.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
config/rewrite.yml Reorders/regroups OpenRewrite recipes and introduces/renames recipe definitions and section headers.
config/jsoref-spellchecker/whitelist.words Adds SAST to the allowed word list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread config/rewrite.yml Outdated
Comment on lines +21 to +22
- org.openrewrite.staticanalysis.CommonStaticAnalysis
# individual recipes
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

recipeList includes org.openrewrite.staticanalysis.CommonStaticAnalysis twice and also repeats the # individual recipes section header, which will cause the same composite recipe to run multiple times. Remove the duplicate entry/header so each recipe is listed only once.

Suggested change
- org.openrewrite.staticanalysis.CommonStaticAnalysis
# individual recipes

Copilot uses AI. Check for mistakes.
Comment thread config/rewrite.yml
Comment thread config/rewrite.yml
Comment on lines +60 to 66
name: org.openrewrite.staticanalysis.CommonStaticAnalysis
displayName: Common static analysis issues
description: |
Resolve common static analysis issues (also known as SAST issues).
recipeList:
- tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes
- tech.picnic.errorprone.refasterrules.CharSequenceRulesRecipes
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

This recipe is named org.openrewrite.staticanalysis.CommonStaticAnalysis, but it only contains tech.picnic.errorprone.refasterrules.* entries. Reusing the OpenRewrite built-in recipe ID here is likely to shadow/override the upstream recipe and also makes the name/description misleading. Rename this recipe back to a Checkstyle-owned ID (e.g., org.checkstyle.RefasterRules) or remove it and reference the upstream recipe directly.

Copilot uses AI. Check for mistakes.
Comment thread config/rewrite.yml Outdated
Comment on lines +40 to +88
type: specs.openrewrite.org/v1beta/recipe
name: org.checkstyle.StaticAnalysis
description: OpenRewrite standard fixes.
name: org.openrewrite.staticanalysis.CommonStaticAnalysis
displayName: Common static analysis issues
description: |
Resolve common static analysis issues (also known as SAST issues).
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

org.openrewrite.staticanalysis.CommonStaticAnalysis is defined a second time later in the same YAML file. Duplicate recipe names in a recipe catalog are ambiguous and can lead to one definition overriding the other (or load failures). Ensure each recipe name is unique (e.g., keep only one definition for this ID, and give other groups a different name).

Copilot uses AI. Check for mistakes.
Comment thread config/rewrite.yml Outdated
Comment thread config/rewrite.yml
Comment on lines +156 to +160
type: specs.openrewrite.org/v1beta/recipe
name: org.checkstyle.AutoFixesPart2
displayName: Auto Fixes Part 2
description: ErrorProne Refaster rules.
recipeList:
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

org.checkstyle.AutoFixesPart2 is defined here but is not referenced by any other recipe in this file (and org.checkstyle.AllAutoFixes in particular still references org.checkstyle.RefasterRules/org.checkstyle.StaticAnalysis). Either wire this new recipe into the active recipe graph or remove it to avoid dead/unused configuration.

Copilot uses AI. Check for mistakes.
Comment thread config/rewrite.yml Outdated
Comment on lines +170 to +171
# current maintainer don't "like" orElseThrow() as better form of get()
# - tech.picnic.errorprone.refasterrules.OptionalRulesRecipes
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

Grammar in this comment is incorrect: "current maintainer don't" should be "current maintainer doesn't".

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

org.openrewrite.staticanalysis.CommonStaticAnalysis is defined a second time later in the same YAML file. Duplicate recipe names in a recipe catalog are ambiguous and can lead to one definition overriding the other (or load failures). Ensure each recipe name is unique (e.g., keep only one definition for this ID, and give other groups a different name).

Comment thread config/rewrite.yml
@Anushreebasics Anushreebasics force-pushed the openrewrite branch 4 times, most recently from 945802c to 0195a9c Compare February 3, 2026 10:06
@Anushreebasics
Copy link
Copy Markdown
Contributor Author

@romani please review

Anushreebasics added a commit to Anushreebasics/checkstyle that referenced this pull request Feb 4, 2026
…documentation with Example3 showing Apache license header matching
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Feb 4, 2026
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Feb 4, 2026
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Feb 4, 2026
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Feb 4, 2026
Comment thread config/rewrite.yml
Comment thread config/rewrite.yml
- org.openrewrite.java.format.PadEmptyForLoopComponents
- org.openrewrite.java.format.RemoveTrailingWhitespace
# until https://github.com/checkstyle/checkstyle/issues/18789
# - org.openrewrite.java.migrate.UpgradeToJava21
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  • org.openrewrite.java.migrate.UpgradeToJava21

Comment thread config/rewrite.yml
romani pushed a commit that referenced this pull request Feb 4, 2026
@github-actions github-actions Bot modified the milestones: 13.1.0, 13.2.0 Feb 4, 2026
Copy link
Copy Markdown
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

Comment thread config/rewrite.yml
# Composite group for static analysis, as on openrewrite website
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.staticanalysis.CommonStaticAnalysis
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 use this group in most top list , under "composite recipes"

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.

@Anushreebasics , I expect simple update to make copy from web and disablement of what was not activated before.
Do not listen to @Pankraz76 , and simply try to archive simple goal. You have chance to merged quicker than his PRs

@Anushreebasics Anushreebasics force-pushed the openrewrite branch 3 times, most recently from 106319a to 3c0e858 Compare February 5, 2026 08:16
@Anushreebasics
Copy link
Copy Markdown
Contributor Author

@romani please review

@Anushreebasics Anushreebasics force-pushed the openrewrite branch 2 times, most recently from 792232c to 2c45a8b Compare February 5, 2026 12:57
@Anushreebasics
Copy link
Copy Markdown
Contributor Author

@romani please review

@romani
Copy link
Copy Markdown
Member

romani commented Feb 17, 2026

CI is red, please fix

@Anushreebasics
Copy link
Copy Markdown
Contributor Author

@romani please review

@romani
Copy link
Copy Markdown
Member

romani commented Feb 17, 2026

Expected update was like #18953

@romani romani closed this Feb 17, 2026
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.

Organize openrewrite staticanalysis composite recipes by groups as it is done on openrewrite website

5 participants