-
Notifications
You must be signed in to change notification settings - Fork 852
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reformat parameter comments in the canonical Java format (
/* foo= */
).
This only formats comments that would already trigger the `ParameterComment` check; it shouldn't make things parameter comments which could then cause compilation errors. PiperOrigin-RevId: 486631656
- Loading branch information
1 parent
c1ea933
commit dda4321
Showing
7 changed files
with
119 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
core/src/test/resources/com/google/googlejavaformat/java/testdata/ParameterComment.input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.google.googlejavaformat.java.test; | ||
|
||
/** Tests for formatting of ParameterComments. */ | ||
class Q { | ||
static void f(int a) { | ||
f(/*a=*/ 1); | ||
f( | ||
/* a= */ 1 | ||
); | ||
} | ||
static void g(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k) { | ||
g( | ||
/*a=*/ 1, | ||
/*b=*/ 1, | ||
/*c=*/ 1, | ||
/*d=*/ 1, | ||
/*e=*/ 1, | ||
/*f=*/ 1, | ||
/*g=*/ 1, | ||
/*h=*/ 1, | ||
/*i=*/ 1, | ||
/*j=*/ 1, | ||
/*k=*/ 1); | ||
g(/*a=*/ 1, /*b=*/ 1, /*c=*/ 1, /*d=*/ 1, /*e=*/ 1, /*f=*/ 1, /*g=*/ 1, /*h=*/ 1, /*i=*/ 1); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
core/src/test/resources/com/google/googlejavaformat/java/testdata/ParameterComment.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.google.googlejavaformat.java.test; | ||
|
||
/** Tests for formatting of ParameterComments. */ | ||
class Q { | ||
static void f(int a) { | ||
f(/* a= */ 1); | ||
f(/* a= */ 1); | ||
} | ||
|
||
static void g(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k) { | ||
g( | ||
/* a= */ 1, | ||
/* b= */ 1, | ||
/* c= */ 1, | ||
/* d= */ 1, | ||
/* e= */ 1, | ||
/* f= */ 1, | ||
/* g= */ 1, | ||
/* h= */ 1, | ||
/* i= */ 1, | ||
/* j= */ 1, | ||
/* k= */ 1); | ||
g( | ||
/* a= */ 1, | ||
/* b= */ 1, | ||
/* c= */ 1, | ||
/* d= */ 1, | ||
/* e= */ 1, | ||
/* f= */ 1, | ||
/* g= */ 1, | ||
/* h= */ 1, | ||
/* i= */ 1); | ||
} | ||
} |