lishunli / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 0 forks source link

Delombok should not add trailing whitespace on newlines #603

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Take a @Data-annotated class with a couple private static final String fields
2. Delombok it
3. Notice that what should be newlines in-between getters and setters actually 
have a single tab of whitespace

What is the expected output? What do you see instead?

No trailing whitespace.

What version of the product are you using? On what operating system?

1.12.2

Original issue reported on code.google.com by cbe...@gmail.com on 8 Nov 2013 at 10:18

GoogleCodeExporter commented 9 years ago
This is a matter of style and personal preference.

I consider tabs on a line not as "trailing whitespace", but as "nice context 
level markers" since they align the newline characters with the same 
indentation level as the code around it.

I don't know how hard it would be to fix, nor if making this configurable and 
added code complexity is worth the benefit.

Original comment by r.spilker on 8 Nov 2013 at 1:00

GoogleCodeExporter commented 9 years ago
We've implemented something on a branch (pretty-delombok). For now it exposes 
some command line parameters, but also heuristics on the source file to just 
"do the right thing".

Original comment by r.spilker on 20 Nov 2013 at 12:43

GoogleCodeExporter commented 9 years ago
Note that git considers trailing whitespace to be an error by default. I 
personally couldn't agree more. Using any invisible garbage is for me next to 
using variable names like `clаss` (you can see the U+0430, right?).

But seriously, I might like the idea of indenting the empty line if it was 
visible in Eclipse (I'd bet Emacs could do it easily). But in general, what's 
invisible should be non-existent as well.

However, the style autodetection idea is cool. If there's some trailing 
whitespace in the existing code, adding more of it can do no more harm.

Original comment by Maaarti...@gmail.com on 8 Dec 2013 at 5:21

GoogleCodeExporter commented 9 years ago
Marked as duplicate of the umbrella issue 608.

Original comment by r.spilker on 11 Dec 2013 at 8:32