-
Notifications
You must be signed in to change notification settings - Fork 870
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow blank lines inserted before comments.
Previously, blank lines could only be emitted before comments if they were there in the input. This was irrespective of BlankLineWanted.YES hints in the OpBuilder. These hints are already being set by some paths in GJF, so now that they're respected, blank lines will be added to some existing files. Eval in unknown commit PiperOrigin-RevId: 514817708
- Loading branch information
Showing
5 changed files
with
18 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ enum TrailingComment { | |
|
||
/** a */ | ||
Object a; | ||
|
||
/** b */ | ||
Object b; | ||
} |
7 changes: 7 additions & 0 deletions
7
core/src/test/resources/com/google/googlejavaformat/java/testdata/Fields.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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
class Fields { | ||
|
||
int a = 1; | ||
int b = 1; | ||
|
||
int c = 1; | ||
/** Javadoc */ | ||
int d = 1; | ||
|
||
int x = 1; | ||
|
||
int y = 1; | ||
|
8 changes: 8 additions & 0 deletions
8
core/src/test/resources/com/google/googlejavaformat/java/testdata/Fields.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 |
---|---|---|
@@ -1,5 +1,13 @@ | ||
class Fields { | ||
|
||
int a = 1; | ||
int b = 1; | ||
|
||
int c = 1; | ||
|
||
/** Javadoc */ | ||
int d = 1; | ||
|
||
int x = 1; | ||
|
||
int y = 1; | ||
|