You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable the on/off tags (@formatter:off, @formatter:on) so that comments can be
formatted manually in exceptional cases, such as to provide an ASCII table in a
comment to describe a block of code's expected behavior to other developers,
when the formatting rules would have made the comment less readable by
collapsing whitespace and line-wrapping. This feature exists already in
Eclipse, and is enabled by this patch.
Example:
/*
* The following method returns the following results
* @formatter:off
* +-------+-------+-------------------+
* | c="a" | c="b" | anything else |
* +-------+-------+-------------------+
* | true | false | true iff f(c)>200 |
* +-------+-------+-------------------+
* @formatter:on
*/
public boolean myMethod(String c);
Original issue reported on code.google.com by ctubbsii on 15 Aug 2014 at 10:44
So, this has become more important now, because I've realized that Eclipse
cannot enforce the column limit[1] in some cases. It ignores trailing
punctuation and other issues[2]. This means that formatting in Eclipse is not
possible in all cases, unless a way is provided to bypass the Eclipse formatter
with some manual solution[3].
This allows projects to enforce the style guide with an automated build tool,
such as checkstyle, but still develop/format in Eclipse.
Please apply the provided patch to enable compliance with the maximum columns
guideline through manual intervention against the buggy Eclipse formatter.
[1]:
http://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s4.4-column-lim
it
[2]: https://bugs.eclipse.org/bugs/show_bug.cgi?id=455852
https://bugs.eclipse.org/bugs/show_bug.cgi?id=303519
https://bugs.eclipse.org/bugs/show_bug.cgi?id=76633
https://bugs.eclipse.org/bugs/show_bug.cgi?id=110569
https://bugs.eclipse.org/bugs/show_bug.cgi?id=179796
[3]:
http://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s4.5-line-wrapp
ing
Original comment by ctubbsii on 23 Dec 2014 at 10:49
Original issue reported on code.google.com by
ctubbsii
on 15 Aug 2014 at 10:44Attachments:
The text was updated successfully, but these errors were encountered: