Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for /trunk/eclipse-java-google-style.xml #27

Open
GoogleCodeExporter opened this issue May 13, 2015 · 3 comments
Open

Patch for /trunk/eclipse-java-google-style.xml #27

GoogleCodeExporter opened this issue May 13, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

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

Attachments:

@GoogleCodeExporter
Copy link
Author

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

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Updated git formatted patch from 
https://github.com/ctubbsii/google-styleguide/tree/issue-27

Original comment by ctubbsii on 23 Dec 2014 at 11:19

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant