Even a better idea.
Allow for a different format on "open file" than the format on "close file".
This way everyone can see the file in his/her preferred formatting but the saved version is always in the "project enforced" format
As we are at it: please not only for java files but also for cdt supported files.
Jantje
Op 15/03/2016 om 16:35 schreef Marc Khouzam:
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.
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).
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.
Doug.
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev