There seem to be conflicting recommendations on autocrlf for Windows, so I don't know what to do. So I leave it unchanged as I think should be the case for any non-project persisted setting.
For OCL, all projects are set to Unix, UTF-8 so most tools respect that and get it right automatically. I'm steadily reporting bugs on tools that don't. Occasionally I need to do a convert-all to Unix to see what CRLFs have leaked.
On 19/03/2014 16:33, Christian W. Damus wrote:
Hi, Team,
What is our policy vis-a-vis formatting of generated code? Is it
- don't format the code: let GMF/Xtend just produce whatever it produces, or
- format the generated source tree using your own preferred formatting style, or
- format the generated source tree using the Papyrus Formatter Profile
Naturally, I would vote for the last option to ensure consistency. :-)
I ask because I changed the DiagramUpdater template on a branch to change how it finds inverse cross-references and regenerated the class diagram, then formatted the code with the formatter profile from
doc/DevelopperDocuments/templates/Papyrus Formatter profile.xml
in the git repository. The result was 576 files changed only by differences in the formatting, not the substance.
While we're on the subject, I often see commits that have lots of changes only in formatting (conforming to the above-mentioned profile). I have so far resisted configuring the JDT's "save action" for formatting the file because I didn't want to introduce
noisy changes into git, instead only formatting the locality of each of my edits. It would be nice just to let the editor automatically format everything so that we can gradually converge on a uniformly formatted codebase, assuming (of course) that every
committer does the same, with the same formatting profile! Shall we agree to do this? Or are there other recommendations?
There is also the question of git's line-terminator settings. Those of us that are not on Windows platform often see CRLF line-terminations in the Papyrus source files. I, for one, follow the (historically) recommended practice of setting my global gitconfig
to core.autocrlf=input on Mac. Does everybody on the team that uses Windows have the same core.autocrlf setting? (regardless whether it's false, true, or input, though usually Windows users set it to true)
Git has since evolved its line-terminator management strategy using a .gitattributes file in the repository to ensure that teams will have a consistent story for that repo, as described here:
Thanks,
Christian
_______________________________________________
mdt-papyrus.dev mailing list
mdt-papyrus.dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mdt-papyrus.dev
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4336 / Virus Database: 3722/7214 - Release Date: 03/19/14