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

Delombok should not add trailing whitespace on newlines #638

Closed
lombokissues opened this issue Jul 14, 2015 · 7 comments
Closed

Delombok should not add trailing whitespace on newlines #638

lombokissues opened this issue Jul 14, 2015 · 7 comments

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 603)

@lombokissues
Copy link
Author

👤 cbeams   🕗 Nov 08, 2013 at 10:18 UTC

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

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Nov 08, 2013 at 13:00 UTC

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.

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Nov 20, 2013 at 00:43 UTC

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".

@lombokissues
Copy link
Author

👤 Maaartinus   🕗 Dec 08, 2013 at 05:21 UTC

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.

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Dec 11, 2013 at 20:32 UTC

Marked as duplicate of the umbrella issue #643.

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Dec 11, 2013 at 20:32 UTC

Duplicate of issue #643

@lombokissues
Copy link
Author

End of migration

lianhaijun pushed a commit to lianhaijun/lombok that referenced this issue May 8, 2020
Bumps org.jetbrains.grammarkit from 2018.3 to 2019.2.
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