Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Reformatting of code

Here's a better idea.
The "format on save" setting has an option to only reformat edited lines.  That sounds like the right way to go.  That will make sure your changes are right, but not affect the rest.  For other project than CDT that do follow the fomatting all the time, there is no need to reformat the entire file since it will already be properly formatted.

From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Marc Khouzam [marc.khouzam@xxxxxxxxxxxx]
Sent: March 15, 2016 11:30 AM
To: CDT General developers list.
Subject: Re: [cdt-dev] Reformatting of code

I realize it is easier to have standard way of working.  But in the end that reduces once person's efforts by pushing them on to others.

I'm willing to compromise with proposal #2 which is to reformat in a separate commit.  It will take an extra 2 minutes to do, but will save much more for the person coming after.

And BTW, turning off the auto-reformat on save, is a lot easier than spending an hour merging code.  You could even write an EASE script to add a button to toggle the reformatter (if that doesn't exist already).

From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Doug Schaefer [cdtdoug@xxxxxxxxx]
Sent: March 15, 2016 11:13 AM
To: CDT General developers list.
Subject: Re: [cdt-dev] Reformatting of code

I work on several projects. CDT is only one of them. I'd prefer not to have per project requirements for this. It's too hard to keep straight.

I also have format on save turned on to make sure I format all the code I touch. I recommend everyone do the same and use the default Java formatter. Then this will be less of an issue over time as we get all or code formatted the same.


On Tue, Mar 15, 2016 at 10:13 AM, Marc Khouzam <marc.khouzam@xxxxxxxxxxxx> wrote:

I would like to suggest a procedure when reformatting entire java files for CDT.

Personally, I use the git history very much, so reformatting has an impact on that.
Merging local changes can also become quite painful.
I recently spent over an hour merging a local change into a file that had been
fully reformatted. This does not feel like time well-spent.  And it's not enjoyable either.

I suggest that either:
1- we simply avoid reformatting
2- if justified, any file reformatting be done in its own commit



cdt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top