Skip to content

Add missing RSPEC tags and fix inconsistent tag formatting#826

Merged
timtebeek merged 1 commit intomainfrom
add-rspec-tags
Mar 10, 2026
Merged

Add missing RSPEC tags and fix inconsistent tag formatting#826
timtebeek merged 1 commit intomainfrom
add-rspec-tags

Conversation

@timtebeek
Copy link
Copy Markdown
Member

@timtebeek timtebeek commented Mar 10, 2026

Summary

  • Add RSPEC tags to 13 recipes that were missing them, by cross-referencing against SonarQube Java coding rules
  • Fix NoFinalizer tag from S1111 to S1113 (S1113 = "finalize() should not be overridden"; S1111 stays on RemoveCallsToObjectFinalize)
  • Fix missing "S" prefix in RSPEC tags for SimplifyBooleanExpression, SimplifyBooleanExpressionWithDeMorgan, and ReplaceDuplicateStringLiterals

New tags added

Recipe Tag SonarQube Rule
LambdaBlockToExpression S1602 Lambdas should not nest single statements in a block
ChainStringBuilderAppendCalls S3024 Arguments to "append" should not be concatenated
UnwrapRepeatableAnnotations S1710 Annotation repetitions should not be wrapped
ReplaceTextBlockWithString S5663 Simple string literal should be used for single line strings
RemoveUnneededBlock S1199 Nested code blocks should not be used
RemoveSystemOutPrintln S106 Standard outputs should not be used directly
InstanceOfPatternMatch S6201 Pattern Matching for "instanceof" should be used
UseStandardCharset S4719 "StandardCharsets" constants should be preferred
ExplicitCharsetOnStringGetBytes S4719 "StandardCharsets" constants should be preferred
ReplaceStackWithDeque S1149 Synchronized classes should not be used
SimplifyTernary S1125 Boolean literals should not be redundant
SimplifyConstantIfBranchExecution S6646 Boolean expressions should not be gratuitous
UnnecessaryReturnAsLastStatement S3626 Jump statements should not be redundant

Test plan

  • ./gradlew compileJava passes successfully
  • Verify tags render correctly in recipe documentation

Add RSPEC tags to 13 recipes by cross-referencing with SonarQube rules:
- LambdaBlockToExpression (S1602)
- ChainStringBuilderAppendCalls (S3024)
- UnwrapRepeatableAnnotations (S1710)
- ReplaceTextBlockWithString (S5663)
- RemoveUnneededBlock (S1199)
- RemoveSystemOutPrintln (S106)
- InstanceOfPatternMatch (S6201)
- UseStandardCharset (S4719)
- ExplicitCharsetOnStringGetBytes (S4719)
- ReplaceStackWithDeque (S1149)
- SimplifyTernary (S1125)
- SimplifyConstantIfBranchExecution (S6646)
- UnnecessaryReturnAsLastStatement (S3626)

Fix NoFinalizer tag from S1111 to S1113 (S1113 = "finalize() should not
be overridden" is the correct match; S1111 stays on
RemoveCallsToObjectFinalize for "finalize() should not be called").

Fix missing "S" prefix in RSPEC tags for SimplifyBooleanExpression,
SimplifyBooleanExpressionWithDeMorgan, and ReplaceDuplicateStringLiterals.
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Mar 10, 2026
@timtebeek timtebeek added the documentation Improvements or additions to documentation label Mar 10, 2026
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite Mar 10, 2026
@timtebeek timtebeek merged commit d672b21 into main Mar 10, 2026
1 check passed
@timtebeek timtebeek deleted the add-rspec-tags branch March 10, 2026 14:45
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Mar 10, 2026
mergify bot added a commit to robfrank/linklift that referenced this pull request Mar 19, 2026
… 2.29.0 to 2.30.0 [skip ci]

Bumps [org.openrewrite.recipe:rewrite-static-analysis](https://github.com/openrewrite/rewrite-static-analysis) from 2.29.0 to 2.30.0.
Release notes

*Sourced from [org.openrewrite.recipe:rewrite-static-analysis's releases](https://github.com/openrewrite/rewrite-static-analysis/releases).*

> 2.30.0
> ------
>
> What's Changed
> --------------
>
> * Disabling C# tests if no .dotnet available by [`@​greg-at-moderne`](https://github.com/greg-at-moderne) in [openrewrite/rewrite-static-analysis#825](https://redirect.github.com/openrewrite/rewrite-static-analysis/pull/825)
> * Add missing RSPEC tags and fix inconsistent tag formatting by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-static-analysis#826](https://redirect.github.com/openrewrite/rewrite-static-analysis/pull/826)
> * Remove `RemoveTrailingWhitespace` by [`@​greg-at-moderne`](https://github.com/greg-at-moderne) in [openrewrite/rewrite-static-analysis#827](https://redirect.github.com/openrewrite/rewrite-static-analysis/pull/827)
>
> **Full Changelog**: <openrewrite/rewrite-static-analysis@v2.29.0...v2.30.0>


Commits

* [`c7cc3e5`](openrewrite/rewrite-static-analysis@c7cc3e5) Remove RemoveTrailingWhitespace ([#827](https://redirect.github.com/openrewrite/rewrite-static-analysis/issues/827))
* [`1f60c9e`](openrewrite/rewrite-static-analysis@1f60c9e) Lombok Best Practices
* [`f3d49bc`](openrewrite/rewrite-static-analysis@f3d49bc) OpenRewrite recipe best practices
* [`d672b21`](openrewrite/rewrite-static-analysis@d672b21) Add missing RSPEC tags and fix inconsistent tag formatting ([#826](https://redirect.github.com/openrewrite/rewrite-static-analysis/issues/826))
* [`bf904bf`](openrewrite/rewrite-static-analysis@bf904bf) Remove `CustomImportOrder` from `CodeCleanup`
* [`0fbe973`](openrewrite/rewrite-static-analysis@0fbe973) Disabling C# tests if no .dotnet available ([#825](https://redirect.github.com/openrewrite/rewrite-static-analysis/issues/825))
* See full diff in [compare view](openrewrite/rewrite-static-analysis@v2.29.0...v2.30.0)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=org.openrewrite.recipe:rewrite-static-analysis&package-manager=maven&previous-version=2.29.0&new-version=2.30.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants