Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-dev] Code formatting

Sorry, I didn't mention this: I would check in our settings with the Tycho sources. In that way, everyone who uses Eclipse will automatically produce properly formatted code. This also means, that we can do (small) modifications to the Eclipse standard where we feel that they are necessary.

I would propose the attached settings (plus save action "format all lines" which is not yet included in the ui.prefs because it adds a whole bulk of irrelevant properties). These settings differ in the following points from the Eclipse default:

1) Line comments are never formatted. Reasons: a) This breaks comments behind a line of code, and b) Code that has been commented out with CTRL-SHIFT-c should not be affected by the formatter save action.
2) Comments are wrapped at column 100. I don't want more than that because I my screen is sometimes not wider than that, and missing words is fatal for a multi-line comment block. I would also agree to anything between 80 and 100.
3) Code is wrapped at column 120. I find the Eclipse default of 80 ridiculously narrow. 100 to 120 would be okay for me. (Up to now we had 120 I think.)
4) A new line at the end of the file is inserted. This could be handy because native git otherwise shows a whitespace warning.

One other thing we might consider changing is the use of tabs. Use tabs for indentation is the Eclipse default, but I wouldn't mind using four spaces instead of tabs (as we have today).

Do you have comments on this? If not I'll check in the configuration for all our projects.

Regards
Tobias


> -----Original Message-----
> From: tycho-dev-bounces@xxxxxxxxxxx [mailto:tycho-dev-bounces@xxxxxxxxxxx]
> On Behalf Of Igor Fedorenko
> Sent: 15 April 2011 16:36
> To: tycho-dev@xxxxxxxxxxx
> Subject: Re: [tycho-dev] Code formatting
> 
> Not sure I understand the last sentence. What "list of all things that I
> changed over the Eclipse default" do you mean?
> 
> As for using eclipse default code formatter... I am +0 for Eclipse code
> style if we can enforce it during the build, using
> maven-checkstyle-plugin or other means, -1 otherwise. I strongly believe
> we need to make sure formatting does not deteriorate over time, or we
> may as well leave the mess we have.
> 
> --
> Regards,
> Igor
> 
> On 11-04-15 09:46 AM, Oberlies, Tobias wrote:
> > Good point. Actually I have a quite strong opinion on the formatting
> > of comments. I don't care much if we start with Maven or Eclipse (as
> > long as we don't use their 80 characters line width). I am used to
> > both by now - but if we want to attract other people from the Eclipse
> > world, we should have a formatting that looks familiar for Eclipse
> > developers. From own experience it takes a while to get used to the
> > Maven formatting.
> >
> > I'll propose a Eclipse-based formatter setting - with a list of all
> > things that I changed over the Eclipse default.
> >
> > Regards Tobias
> >
> >> -----Original Message----- From: tycho-dev-bounces@xxxxxxxxxxx
> >> [mailto:tycho-dev-bounces@xxxxxxxxxxx] On Behalf Of Igor Fedorenko
> >> Sent: 15 April 2011 15:38 To: tycho-dev@xxxxxxxxxxx Subject: Re:
> >> [tycho-dev] Branch-point for releasing
> >>
> >> I still want to apply the same code formatting for all sources.
> >> This needs to happen before branch point, otherwise merges will be
> >> much more difficult. If you have time to do reformatting today,
> >> please go ahead and do it. Otherwise I'll try to find time for this
> >> over the weekend.
> >>
> >> -- Regards, Igor
> >>
> _______________________________________________
> tycho-dev mailing list
> tycho-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/tycho-dev

Attachment: org.eclipse.jdt.core.prefs
Description: org.eclipse.jdt.core.prefs

Attachment: org.eclipse.jdt.ui.prefs
Description: org.eclipse.jdt.ui.prefs


Back to the top