Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand RemoveExtraSemicolons description #454

Merged
merged 8 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ public String getDisplayName() {

@Override
public String getDescription() {
return "Optional semicolons at the end of try-with-resources are also removed.";
//language=markdown
return "Removes not needed semicolons. Semicolons are considered not needed:\n" +
"* Optional semicolons at the end of try-with-resources,\n" +
"* after the last enum value if no field or method is defined,\n" +
"* no statement between two semicolon.";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public Test() {
void noReplaceOnPackageProtectedConstructor() {
rewriteRun(
//language=java
java("""
java(
"""
abstract class Test {
Test() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void enumSemicolonsWithOtherStatements() {
public enum FRUITS {
BANANA,
APPLE;

void hiFruit() {}
}
"""
Expand Down Expand Up @@ -215,6 +215,7 @@ int test() {
}

@Test
@DocumentExample
void repeatedSemicolon() {
rewriteRun(
//language=java
Expand Down
Loading