-
Notifications
You must be signed in to change notification settings - Fork 899
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix formatting of comments in empty structs (#5171)
* Fix formatting of comments in empty structs * Add tests * Add single line tests * Fix block comments * Revert changes of test source files
- Loading branch information
Showing
7 changed files
with
251 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
struct Struct { | ||
// Multiline comment | ||
// should be formatted | ||
// properly. | ||
} | ||
|
||
struct Struct2 { | ||
// This formatting | ||
// Should be changed | ||
} | ||
|
||
struct Struct3( | ||
// This | ||
// is | ||
// correct | ||
); | ||
|
||
struct Struct4( | ||
// This | ||
// is | ||
// not | ||
// correct | ||
); | ||
|
||
struct Struct5 { | ||
/* | ||
Comment block | ||
with many lines. | ||
*/ | ||
} | ||
|
||
struct Struct6( | ||
/* | ||
Comment block | ||
with many lines. | ||
*/ | ||
); | ||
|
||
struct Struct7 { | ||
/* | ||
Invalid | ||
format | ||
*/ | ||
} | ||
|
||
struct Struct8( | ||
/* | ||
Invalid | ||
format | ||
*/ | ||
); | ||
|
||
struct Struct9 { /* bar */ } | ||
|
||
struct Struct10 { /* bar | ||
baz | ||
*/ } | ||
|
||
mod module { | ||
struct Struct { | ||
// Multiline comment | ||
// should be formatted | ||
// properly. | ||
} | ||
|
||
struct Struct2 { | ||
// This formatting | ||
// Should be changed | ||
} | ||
|
||
struct Struct3( | ||
// This | ||
// is | ||
// correct | ||
); | ||
|
||
struct Struct4( | ||
// This | ||
// is | ||
// not | ||
// correct | ||
); | ||
|
||
struct Struct5 { | ||
/* | ||
Comment block | ||
with many lines. | ||
*/ | ||
} | ||
|
||
struct Struct6( | ||
/* | ||
Comment block | ||
with many lines. | ||
*/ | ||
); | ||
|
||
struct Struct7 { | ||
/* | ||
Invalid | ||
format | ||
*/ | ||
} | ||
|
||
struct Struct8( | ||
/* | ||
Invalid | ||
format | ||
*/ | ||
); | ||
|
||
struct Struct9 { /* bar */ } | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
struct Struct { | ||
// Multiline comment | ||
// should be formatted | ||
// properly. | ||
} | ||
|
||
struct Struct2 { | ||
// This formatting | ||
// Should be changed | ||
} | ||
|
||
struct Struct3( | ||
// This | ||
// is | ||
// correct | ||
); | ||
|
||
struct Struct4( | ||
// This | ||
// is | ||
// not | ||
// correct | ||
); | ||
|
||
struct Struct5 { | ||
/* | ||
Comment block | ||
with many lines. | ||
*/ | ||
} | ||
|
||
struct Struct6( | ||
/* | ||
Comment block | ||
with many lines. | ||
*/ | ||
); | ||
|
||
struct Struct7 { | ||
/* | ||
Invalid | ||
format | ||
*/ | ||
} | ||
|
||
struct Struct8( | ||
/* | ||
Invalid | ||
format | ||
*/ | ||
); | ||
|
||
struct Struct9 {/* bar */} | ||
|
||
struct Struct10 { | ||
/* bar | ||
baz | ||
*/ | ||
} | ||
|
||
mod module { | ||
struct Struct { | ||
// Multiline comment | ||
// should be formatted | ||
// properly. | ||
} | ||
|
||
struct Struct2 { | ||
// This formatting | ||
// Should be changed | ||
} | ||
|
||
struct Struct3( | ||
// This | ||
// is | ||
// correct | ||
); | ||
|
||
struct Struct4( | ||
// This | ||
// is | ||
// not | ||
// correct | ||
); | ||
|
||
struct Struct5 { | ||
/* | ||
Comment block | ||
with many lines. | ||
*/ | ||
} | ||
|
||
struct Struct6( | ||
/* | ||
Comment block | ||
with many lines. | ||
*/ | ||
); | ||
|
||
struct Struct7 { | ||
/* | ||
Invalid | ||
format | ||
*/ | ||
} | ||
|
||
struct Struct8( | ||
/* | ||
Invalid | ||
format | ||
*/ | ||
); | ||
|
||
struct Struct9 {/* bar */} | ||
} |