Skip to content

Commit

Permalink
Apply best practices to reduce noise on PR reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Nov 23, 2024
1 parent 2b05fc2 commit 2b76e9c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ void stringMultipliedInParentheses() {
@Test
void extraParensAroundInfixOperator() {
rewriteRun(
groovy("""
groovy(
"""
def foo(Map map) {
((map.containsKey("foo"))
&& ((map.get("foo")).equals("bar")))
Expand All @@ -217,7 +218,8 @@ def timestamp(int hours, int minutes, int seconds) {
def differenceInDays(int time) {
return (int) ((time)/(1000*60*60*24))
}
""")
"""
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -294,28 +294,32 @@ public final class A {}
@Test
void instanceInitializerBlock() {
rewriteRun(
groovy("""
groovy(
"""
class A {
int a
{
a = 1
}
}
""")
"""
)
);
}

@Test
void staticInitializer() {
rewriteRun(
groovy("""
groovy(
"""
class A {
static int a
static {
a = 1
}
}
""")
"""
)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ void shouldNotFailWhenImportCannotBeResolved() {
@Test
void addingToMaps() {
rewriteRun(
groovy("""
groovy(
"""
class Pair {
String foo
String bar
Expand All @@ -146,7 +147,8 @@ def foo(List l) {
l.add(new Pair("foo", "bar"))
}
}
""")
"""
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,13 @@ void escapedMethodNameWithSpacesTest() {
@Test
void functionWithDefAndExplicitReturnType() {
rewriteRun(
groovy("""
groovy(
"""
class A {
def int one() { 1 }
}
""")
"""
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,13 @@ public J visitVariableDeclarations(J.VariableDeclarations multiVariable, Executi
@Test
void nestedTypeParameters() {
rewriteRun(
groovy("""
groovy(
"""
class A {
def map = new HashMap<String, List<String>>()
}
""")
"""
)
);
}
}

0 comments on commit 2b76e9c

Please sign in to comment.