Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343742 - [LTTng] Tabs and spaces mixed in source code
Summary: [LTTng] Tabs and spaces mixed in source code
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: LinuxTools (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: Alexandre Montplaisir CLA
QA Contact: Francois Chouinard CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-25 11:21 EDT by Francis Giraldeau CLA
Modified: 2022-01-13 14:53 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Giraldeau CLA 2011-04-25 11:21:59 EDT
Build Identifier: HEAD

Code is indented with a mix of tabs and spaces, and it mess up git patched and indentation. Should spaces or tabs be the standard?

There is a file for project settings provided, but it doesn't seems to define formating policy.

Reproducible: Always

Steps to Reproduce:
N/A
Comment 1 Andrew Overholt CLA 2011-08-24 14:59:28 EDT
Linux Tools has never standardized.  If this is important, we can set one up and have one big commit that fixes everything.  We can also set save hooks to auto-format on save.
Comment 2 Francois Chouinard CLA 2011-08-25 09:30:17 EDT
1. Tabs

Spaces don't lie.

As far as I'm concerned, tabs should be strictly forbidden. I don't think there's been a half-decent case for them since data communication broke the 10cps barrier. IMHO, their nuisance far outweighs their presumed usefulness (we will see "Peace in the Middle East" AND "Cure for Cancer" before I change my mind on this one :-)

2. Big commit

I was thinking of going tab-less right after 0.8.1 (LTTng/TMF only). I'm not convinced the other sub-projects want to spend any time on this...

3. Auto-format

I used "format on save" hooks in the Bad Old ClearCase days and it was neat. But I'm not aware of such hooks in Eclipse. How does that work?
Comment 3 Andrew Overholt CLA 2011-08-25 09:37:08 EDT
(In reply to comment #2)
> 2. Big commit
> 
> I was thinking of going tab-less right after 0.8.1 (LTTng/TMF only). I'm not
> convinced the other sub-projects want to spend any time on this...

I'm not aware of anyone caring outside of LTTng/TMF, either.  But I'm sure people wouldn't complain if this were done for all sub-projects

> 3. Auto-format
> 
> I used "format on save" hooks in the Bad Old ClearCase days and it was neat.
> But I'm not aware of such hooks in Eclipse. How does that work?

Ctrl-3 "save actions" -> "Save Actions - Java/Editor".  Check "Perform the selected actions on save" and check the "Format source code" box.
Comment 4 Francois Chouinard CLA 2011-08-25 12:35:20 EDT
> Ctrl-3 "save actions" -> "Save Actions - Java/Editor".  Check "Perform the
> selected actions on save" and check the "Format source code" box.

Thanks for the tip! Ctrl-3 didn't work but setting the pref (Java > Editor > Save Actions) was just as good.
Comment 5 Andrew Overholt CLA 2011-08-25 13:15:48 EDT
Ctrl-awesome ( ;) ) didn't work?
Comment 6 Francois Chouinard CLA 2011-08-25 13:34:03 EDT
I didn't see "save actions" in the popup and didn't realize I had to type it in... My bad :-)

(It is actually awesome :-)
Comment 7 Francois Chouinard CLA 2012-06-12 16:29:48 EDT
Postponed to after Juno.
Comment 8 Patrick Tasse CLA 2013-05-16 17:19:44 EDT
Project settings have been added with space-only tab formatting.

https://git.eclipse.org/r/6905

Pushed to master branch
commit 62c12f61298de942ca9465d0b482d490fe3f7bef

Released in 1.2.