Bug 107990 - Automatic code formatting when interacting with team repository
Summary: Automatic code formatting when interacting with team repository
Status: RESOLVED DUPLICATE of bug 45423
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-25 10:25 EDT by Thomas Hallgren CLA
Modified: 2005-08-25 11:22 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Hallgren CLA 2005-08-25 10:25:43 EDT
I think many of us have fought a war concerning code formatting conventions at
some point. I think that is a waste of energy and valuable resources (well, it
can be amusing also, but anyway) so I propose the following enhancement:

As a first step, Eclipse should provide a way to automatically reformat code
that is checked out from a team repository (CVS first of course) according to
user preference and reverse that formatting whenever code is checked in
according to another preference. The automatic formatting must of course apply
when files are compared also.

In a later iteration, the same kind of formatting should be possible whenever a
remote sources is viewed (such as the source to the rt.jar, the Eclipse plugins,
etc.). This should also be controlled by a user preference setting.

In an even later iteration, more conventions could be enforced. The sorting of
members for instance. That however, implies improvements that prevent the
initialization order of the members to change when that order is relevant.

Rationale:
Many of us have different opinions about the placement of curly braces, indents,
whitespace etc. All of that is totally irrelevant for the actual code and its
semantics. A situation where I can work with the code formatted to suite my
needs while someone else does the same using a completely different formatting
would be ideal as long as it's always checked in in accordance with some common
agreement.

It's often argued that automatic formatting of code results in unnecessary
merges. The truth is actually the opposite. If automatic formatting used
consistently, all differences due to difference in code format disappear.
Comment 1 Dani Megert CLA 2005-08-25 11:22:55 EDT

*** This bug has been marked as a duplicate of 45423 ***