You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@esme.apache.org by Vassil Dichev <vd...@apache.org> on 2010/06/02 22:56:07 UTC

Style conventions

I just took the liberty of formatting a couple of files (API2,
API2Test and AuthToken) which looked just... wrong in my editor. The
reason was that some lines were indented using tabs, while the Scala
convention (used in the rest of the ESME files) uses 2 spaces for
indentation.

We posted a Scala Style guide some time ago
(http://davetron5000.github.com/scala-style/), it would be really
helpful if we could stick to it! In order to do so, it is necessary
that our editors/IDEs are set up to respect this convention and not
apply formatting which might surprise others.

Sorry for the nitpick, but documents with mixed tabs/spaces, while
they look perfectly OK on editors with the "correct" tab size, produce
horrendous results in editors with a different indentation setting.

Vassil

Re: Style conventions

Posted by Richard Hirsch <hi...@gmail.com>.
On Wed, Jun 2, 2010 at 11:44 PM, Vassil Dichev <vd...@apache.org> wrote:
> I configured my editor (jEdit) to untabify according to the set tab
> size, but I checked  the results manually. This is not an easy task, I
> know...
>
> There is a Scala formatter I've heard about recently, maybe it's time
> for me to try it out:
>
> http://github.com/mdr/scalariform

This looks good and is an eclipse plug-in. If this work well ( based
on git stats, the developer is stillactively working on it), we could
create a wiki page with the project-specific formatting rules.

>
>
> On Thu, Jun 3, 2010 at 12:22 AM, Richard Hirsch <hi...@gmail.com> wrote:
>> How did you indent? Manually or with a tool?
>>
>> I've been experimenting with Scala Formatter in Eclipse but it doesn't
>> always work correctly.
>>
>> D.
>>
>> On Wed, Jun 2, 2010 at 10:56 PM, Vassil Dichev <vd...@apache.org> wrote:
>>> I just took the liberty of formatting a couple of files (API2,
>>> API2Test and AuthToken) which looked just... wrong in my editor. The
>>> reason was that some lines were indented using tabs, while the Scala
>>> convention (used in the rest of the ESME files) uses 2 spaces for
>>> indentation.
>>>
>>> We posted a Scala Style guide some time ago
>>> (http://davetron5000.github.com/scala-style/), it would be really
>>> helpful if we could stick to it! In order to do so, it is necessary
>>> that our editors/IDEs are set up to respect this convention and not
>>> apply formatting which might surprise others.
>>>
>>> Sorry for the nitpick, but documents with mixed tabs/spaces, while
>>> they look perfectly OK on editors with the "correct" tab size, produce
>>> horrendous results in editors with a different indentation setting.
>>>
>>> Vassil
>>>
>>
>

Re: Style conventions

Posted by Ethan Jewett <es...@gmail.com>.
Clearly I did not have 15 seconds to just Google it :-) Seriously, I've been
looking for this occasionally for months. No idea how I didn't find it.
Thank you!

Ethan

On Wed, Jun 2, 2010 at 10:16 PM, Vassil Dichev <vd...@apache.org> wrote:

> @Ethan, the hint at the bottom should help:
>
>
> http://manual.macromates.com/en/working_with_text#using_spaces_instead_of_tabs
>
>
> On Thu, Jun 3, 2010 at 3:53 AM, Ethan Jewett <es...@gmail.com> wrote:
> > Hi,
> >
> > I think this is probably my fault. I'm using Textmate and I'm not very
> > disciplined about using spaces instead of tabs :-( I'll try to stick to
> > spaces in the future and hopefully figure out how to turn off the
> > auto-indenting that it does.
> >
> > Ethan
> >
> > On Wed, Jun 2, 2010 at 4:44 PM, Vassil Dichev <vd...@apache.org>
> wrote:
> >
> >> I configured my editor (jEdit) to untabify according to the set tab
> >> size, but I checked  the results manually. This is not an easy task, I
> >> know...
> >>
> >> There is a Scala formatter I've heard about recently, maybe it's time
> >> for me to try it out:
> >>
> >> http://github.com/mdr/scalariform
> >>
> >>
> >> On Thu, Jun 3, 2010 at 12:22 AM, Richard Hirsch <hi...@gmail.com>
> >> wrote:
> >> > How did you indent? Manually or with a tool?
> >> >
> >> > I've been experimenting with Scala Formatter in Eclipse but it doesn't
> >> > always work correctly.
> >> >
> >> > D.
> >> >
> >> > On Wed, Jun 2, 2010 at 10:56 PM, Vassil Dichev <vd...@apache.org>
> >> wrote:
> >> >> I just took the liberty of formatting a couple of files (API2,
> >> >> API2Test and AuthToken) which looked just... wrong in my editor. The
> >> >> reason was that some lines were indented using tabs, while the Scala
> >> >> convention (used in the rest of the ESME files) uses 2 spaces for
> >> >> indentation.
> >> >>
> >> >> We posted a Scala Style guide some time ago
> >> >> (http://davetron5000.github.com/scala-style/), it would be really
> >> >> helpful if we could stick to it! In order to do so, it is necessary
> >> >> that our editors/IDEs are set up to respect this convention and not
> >> >> apply formatting which might surprise others.
> >> >>
> >> >> Sorry for the nitpick, but documents with mixed tabs/spaces, while
> >> >> they look perfectly OK on editors with the "correct" tab size,
> produce
> >> >> horrendous results in editors with a different indentation setting.
> >> >>
> >> >> Vassil
> >> >>
> >> >
> >>
> >
>

Re: Style conventions

Posted by Vassil Dichev <vd...@apache.org>.
@Ethan, the hint at the bottom should help:

http://manual.macromates.com/en/working_with_text#using_spaces_instead_of_tabs


On Thu, Jun 3, 2010 at 3:53 AM, Ethan Jewett <es...@gmail.com> wrote:
> Hi,
>
> I think this is probably my fault. I'm using Textmate and I'm not very
> disciplined about using spaces instead of tabs :-( I'll try to stick to
> spaces in the future and hopefully figure out how to turn off the
> auto-indenting that it does.
>
> Ethan
>
> On Wed, Jun 2, 2010 at 4:44 PM, Vassil Dichev <vd...@apache.org> wrote:
>
>> I configured my editor (jEdit) to untabify according to the set tab
>> size, but I checked  the results manually. This is not an easy task, I
>> know...
>>
>> There is a Scala formatter I've heard about recently, maybe it's time
>> for me to try it out:
>>
>> http://github.com/mdr/scalariform
>>
>>
>> On Thu, Jun 3, 2010 at 12:22 AM, Richard Hirsch <hi...@gmail.com>
>> wrote:
>> > How did you indent? Manually or with a tool?
>> >
>> > I've been experimenting with Scala Formatter in Eclipse but it doesn't
>> > always work correctly.
>> >
>> > D.
>> >
>> > On Wed, Jun 2, 2010 at 10:56 PM, Vassil Dichev <vd...@apache.org>
>> wrote:
>> >> I just took the liberty of formatting a couple of files (API2,
>> >> API2Test and AuthToken) which looked just... wrong in my editor. The
>> >> reason was that some lines were indented using tabs, while the Scala
>> >> convention (used in the rest of the ESME files) uses 2 spaces for
>> >> indentation.
>> >>
>> >> We posted a Scala Style guide some time ago
>> >> (http://davetron5000.github.com/scala-style/), it would be really
>> >> helpful if we could stick to it! In order to do so, it is necessary
>> >> that our editors/IDEs are set up to respect this convention and not
>> >> apply formatting which might surprise others.
>> >>
>> >> Sorry for the nitpick, but documents with mixed tabs/spaces, while
>> >> they look perfectly OK on editors with the "correct" tab size, produce
>> >> horrendous results in editors with a different indentation setting.
>> >>
>> >> Vassil
>> >>
>> >
>>
>

Re: Style conventions

Posted by Ethan Jewett <es...@gmail.com>.
Hi,

I think this is probably my fault. I'm using Textmate and I'm not very
disciplined about using spaces instead of tabs :-( I'll try to stick to
spaces in the future and hopefully figure out how to turn off the
auto-indenting that it does.

Ethan

On Wed, Jun 2, 2010 at 4:44 PM, Vassil Dichev <vd...@apache.org> wrote:

> I configured my editor (jEdit) to untabify according to the set tab
> size, but I checked  the results manually. This is not an easy task, I
> know...
>
> There is a Scala formatter I've heard about recently, maybe it's time
> for me to try it out:
>
> http://github.com/mdr/scalariform
>
>
> On Thu, Jun 3, 2010 at 12:22 AM, Richard Hirsch <hi...@gmail.com>
> wrote:
> > How did you indent? Manually or with a tool?
> >
> > I've been experimenting with Scala Formatter in Eclipse but it doesn't
> > always work correctly.
> >
> > D.
> >
> > On Wed, Jun 2, 2010 at 10:56 PM, Vassil Dichev <vd...@apache.org>
> wrote:
> >> I just took the liberty of formatting a couple of files (API2,
> >> API2Test and AuthToken) which looked just... wrong in my editor. The
> >> reason was that some lines were indented using tabs, while the Scala
> >> convention (used in the rest of the ESME files) uses 2 spaces for
> >> indentation.
> >>
> >> We posted a Scala Style guide some time ago
> >> (http://davetron5000.github.com/scala-style/), it would be really
> >> helpful if we could stick to it! In order to do so, it is necessary
> >> that our editors/IDEs are set up to respect this convention and not
> >> apply formatting which might surprise others.
> >>
> >> Sorry for the nitpick, but documents with mixed tabs/spaces, while
> >> they look perfectly OK on editors with the "correct" tab size, produce
> >> horrendous results in editors with a different indentation setting.
> >>
> >> Vassil
> >>
> >
>

Re: Style conventions

Posted by Vassil Dichev <vd...@apache.org>.
I configured my editor (jEdit) to untabify according to the set tab
size, but I checked  the results manually. This is not an easy task, I
know...

There is a Scala formatter I've heard about recently, maybe it's time
for me to try it out:

http://github.com/mdr/scalariform


On Thu, Jun 3, 2010 at 12:22 AM, Richard Hirsch <hi...@gmail.com> wrote:
> How did you indent? Manually or with a tool?
>
> I've been experimenting with Scala Formatter in Eclipse but it doesn't
> always work correctly.
>
> D.
>
> On Wed, Jun 2, 2010 at 10:56 PM, Vassil Dichev <vd...@apache.org> wrote:
>> I just took the liberty of formatting a couple of files (API2,
>> API2Test and AuthToken) which looked just... wrong in my editor. The
>> reason was that some lines were indented using tabs, while the Scala
>> convention (used in the rest of the ESME files) uses 2 spaces for
>> indentation.
>>
>> We posted a Scala Style guide some time ago
>> (http://davetron5000.github.com/scala-style/), it would be really
>> helpful if we could stick to it! In order to do so, it is necessary
>> that our editors/IDEs are set up to respect this convention and not
>> apply formatting which might surprise others.
>>
>> Sorry for the nitpick, but documents with mixed tabs/spaces, while
>> they look perfectly OK on editors with the "correct" tab size, produce
>> horrendous results in editors with a different indentation setting.
>>
>> Vassil
>>
>

Re: Style conventions

Posted by Richard Hirsch <hi...@gmail.com>.
How did you indent? Manually or with a tool?

I've been experimenting with Scala Formatter in Eclipse but it doesn't
always work correctly.

D.

On Wed, Jun 2, 2010 at 10:56 PM, Vassil Dichev <vd...@apache.org> wrote:
> I just took the liberty of formatting a couple of files (API2,
> API2Test and AuthToken) which looked just... wrong in my editor. The
> reason was that some lines were indented using tabs, while the Scala
> convention (used in the rest of the ESME files) uses 2 spaces for
> indentation.
>
> We posted a Scala Style guide some time ago
> (http://davetron5000.github.com/scala-style/), it would be really
> helpful if we could stick to it! In order to do so, it is necessary
> that our editors/IDEs are set up to respect this convention and not
> apply formatting which might surprise others.
>
> Sorry for the nitpick, but documents with mixed tabs/spaces, while
> they look perfectly OK on editors with the "correct" tab size, produce
> horrendous results in editors with a different indentation setting.
>
> Vassil
>