| 40 columns | |
| >>> Empty class containing line comment. |
| class C { // comment |
| } |
| <<< |
| class C { |
| // comment |
| } |
| >>> Indent line comment in body. |
| ### Note: The old formatter had a special rule that line comments starting at |
| ### column 1 would not be indented even if the surrounding code otherwise |
| ### required it. The new style deliberately does not have that rule. |
| class C { |
| // comment |
| } |
| <<< |
| class C { |
| // comment |
| } |
| >>> Empty class containing inline block comment. |
| class C { /* comment */ } |
| <<< |
| class C { |
| /* comment */ |
| } |
| >>> Empty class containing non-inline block comment. |
| class C { |
| |
| /* comment */ |
| |
| |
| } |
| <<< |
| class C { |
| /* comment */ |
| } |
| >>> Empty class containing multi-line block comment. |
| class C { /* comment |
| line */ } |
| <<< |
| class C { |
| /* comment |
| line */ |
| } |
| >>> |
| class C { |
| |
| /* comment |
| line */ |
| |
| |
| } |
| <<< |
| class C { |
| /* comment |
| line */ |
| } |
| >>> Remove blank lines before and after comments at end of class. |
| class C { |
| |
| |
| |
| // comment |
| |
| |
| |
| } |
| <<< |
| class C { |
| // comment |
| } |
| >>> Force blank line before doc comment between classes. |
| class Foo {} /// Doc comment. |
| class Bar {} |
| <<< |
| class Foo {} |
| |
| /// Doc comment. |
| class Bar {} |
| >>> Force newline after JavaDoc-style block comment. |
| class Foo {} |
| /** |
| */ class Bar {} |
| <<< |
| class Foo {} |
| |
| /** |
| */ |
| class Bar {} |