Skip to content

Issue #135: Implemented recipe for EmptyStatement#136

Open
tannmayygupta wants to merge 6 commits intocheckstyle:mainfrom
tannmayygupta:feature/empty-statement-recipe
Open

Issue #135: Implemented recipe for EmptyStatement#136
tannmayygupta wants to merge 6 commits intocheckstyle:mainfrom
tannmayygupta:feature/empty-statement-recipe

Conversation

@tannmayygupta
Copy link

@tannmayygupta tannmayygupta commented Jan 30, 2026

Description

Implements OpenRewrite recipe for Checkstyle's EmptyStatement check.

This recipe automatically detects and removes empty statements (standalone semicolons)
that serve no purpose in the code, covering multiple scenarios including control structures.

About Me

  • Name: Tanmay Gupta
  • Background: Pre-final year CS student at RCOEM, Nagpur, India
  • Skills: Java, DSA (CodeChef, Codeforces, LeetCode), Full-stack development
  • Previous Open Source: GirlScript Summer of Code contributor
  • Interest: GSoC 2026 - Checkstyle Auto-Fix Module

Looking forward to contributing more to Checkstyle! 🚀

@Anmol202005
Copy link
Collaborator

These tests should extend AbstractRecipeTestSupport.
Please refer to other recipe test implementations (e.g. NewLineAtEndOfFileTest) and align with the existing pattern.

@tannmayygupta
Copy link
Author

yess sir, i see that other recipe implementations extends AbstractRecipeTestSupport will extend and raise another PR sir.

…or automatic empty statement removal

- Remove standalone empty statements (double semicolons, standalone semicolons)
- Replace empty control flow bodies (if/while/for/do-while) with empty blocks
- Add comprehensive test coverage with 16 test scenarios
- Support both XML and SARIF report formats
@tannmayygupta
Copy link
Author

@Anmol202005 @romani

Sir, implemented EmptyStatement recipe that extends abstractRecipeTest as it was done for other recipe.

@rdiachenko
Copy link
Member

@tannmayygupta please fix ci failures and squash all commits into one

@tannmayygupta
Copy link
Author

@rdiachenko Yes sir, working on it, will fix and squash into one commit.

@tannmayygupta
Copy link
Author

@Anmol202005 @romani @rdiachenko

Sir I've fixed the CI failure and tried to squash in one but the (git rebase -head~3). Please review and let me know if any changes are needed.

@tannmayygupta
Copy link
Author

Sorry Sir,

Didn't expected that it will fail. I read all the previous CI Failure error and tried to fixed them. I will start working on present CI failure.

@tannmayygupta
Copy link
Author

@Anmol202005 @romani @rdiachenko

Sir I've understand and fixed the CI failure. Please review and let me know if any changes are needed.

@rdiachenko
Copy link
Member

rdiachenko commented Feb 3, 2026

@tannmayygupta pitest mutations introduced by your code must be fixed, but not suppressed as you did. Same for checkstyle suppressions. Please make sure this PR doesn't introduce any new suppressions.

@tannmayygupta
Copy link
Author

@rdiachenko Understood Sir. I'll fix the mutations by improving the code logic instead of using suppressions. working on it.

@tannmayygupta
Copy link
Author

tannmayygupta commented Feb 4, 2026

Sir, tried fixing EmptyStatement mutation without suppressions. Please review sir and let me know if any changes are needed.

@romani
Copy link
Member

romani commented Feb 5, 2026

Always single commit in PR, please .

@tannmayygupta
Copy link
Author

Sorry sir, will do it in one commit.

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.

4 participants