Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325936

Summary: [devel] use correct indentation clean-up?
Product: [Modeling] TMF Reporter: Knut Wannheden <knut.wannheden>
Component: Xtext BacklogAssignee: Project Inbox <tmf.xtext-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P5 CC: moritz.eysholdt, sebastian.zarnekow, sven.efftinge
Version: 1.0.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Knut Wannheden CLA 2010-09-22 05:01:58 EDT
I have noticed that not all of Xtext's Java source files consistently use tabs for line indentation. In some files tabs and spaces are happily mixed, sometimes even on the same line. This can cause some headache and confusion for people reading patch files or inspecting commits in the Git web view.

I think we should therefore consider enabling the "Correct indentation" clean-up for Java and also add it as a save action.

What do others think? Do you have bad experiences using this specific clean-up?
Comment 1 Moritz Eysholdt CLA 2010-10-05 16:33:13 EDT
how about...
1. configuring the java formatter so that it produces acceptable results for as may scenarios as possible.
2. enable comment-based on/off tags for the formatter as described here: http://download.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/eclipse-news-part2.html#JavaFormatter This allows to disable the formatter locally for certain regions of the code.
3. use the on/off-tags to disable the formatter for places where it messes up the code.
4. commit the formatting config to git
5. run the formatter on all files

After doing this one could always run the formatter on a complete file without worrying about messing up some someone else's formatting an producing a noisy git-changeset.
Comment 2 Sven Efftinge CLA 2010-10-06 03:01:59 EDT
I think we need to try in order to find out.
Comment 3 Karsten Thoms CLA 2017-07-11 14:26:48 EDT
Closing due to inactivity. Although homogenous formatting is desirable this would mess up quite a lot of code.
Moving to backlog.