Spaces for tabs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Spaces for tabs

Jacques Le Roux
Administrator
Hi all,

Willing to ease this redundant Spaces for Tabs format problem here is a text I propose to put in
http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices

mixing informations from
http://groups.csail.mit.edu/uid/wiki/index.php?title=Getting_Started#Configure_Your_Development_Environment
http://cwiki.apache.org/confluence/display/GMOxDEV/Developing+Geronimo+in+Eclipse
http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php
here are some updated help to allow using spaces in place of tabs in source files in Eclipse 3.

<<
We don't want tab characters in text files in SVN, because different editors and tools interpret tabs differently. All indentation
should be done purely with spaces.
To change tabs to spaces in Eclipse, change these preferences in Window -> Preferences ->
    1. Java -> Code Style -> Code Formatter -> Show... -> Java Conventions [built-in] -> Indentation, select Tab policy as "space
only". Enter a new name for this profile and click "OK".
    2. Java -> Editor -> Typing, and check "Insert spaces for tab".
    3. Ant -> Editor -> Formatter, and uncheck "Use tab character instead of spaces".
    4. If you installed Colorer, Colorer Library Editor -> Uses spaces instead of tabs.
    5. If you installed XML Buddy, XMLBuddy -> Formatting -> Uses spaces instead of tabs.
    6. Unfortunaltely neither of the 2 main FreeMarker pluggin have similar functionnality yet. So for FTL files you have to do that
manually with an external editor.
>>

For point 6 I'm not sure if there is not a better way to do that in Eclipse 3, any idea ?

If some have time and experience maybe we could do the same thing for at least NetBeans ?

BTW,  it seems that groups.csail.mit.edu has a way to avoid finding tabs in source files : "Our Subversion repository will actually
reject commits that include tabs in text files, so you'd better fix this now, or face pain later.". Could that possible in Apache
SVN ?

Jacques

Reply | Threaded
Open this post in threaded view
|

Re: Spaces for tabs

Jacques Le Roux
Administrator
I just found the wonderful command Ctrl+I in Eclipse 3.2. A must to correct indentation and transform tabs to spaces after having
set like indicated below.

Is somebody aware of a command/tool in Eclipse (or even off) able to get rid of useless spaces and tabs at end of lines ?

Thanks

Jacques

----- Original Message -----
From: "Jacques Le Roux" <[hidden email]>
To: <[hidden email]>
Sent: Monday, November 13, 2006 10:24 AM
Subject: Spaces for tabs


> Hi all,
>
> Willing to ease this redundant Spaces for Tabs format problem here is a text I propose to put in
> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices
>
> mixing informations from
> http://groups.csail.mit.edu/uid/wiki/index.php?title=Getting_Started#Configure_Your_Development_Environment
> http://cwiki.apache.org/confluence/display/GMOxDEV/Developing+Geronimo+in+Eclipse
> http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php
> here are some updated help to allow using spaces in place of tabs in source files in Eclipse 3.
>
> <<
> We don't want tab characters in text files in SVN, because different editors and tools interpret tabs differently. All indentation
> should be done purely with spaces.
> To change tabs to spaces in Eclipse, change these preferences in Window -> Preferences ->
>     1. Java -> Code Style -> Code Formatter -> Show... -> Java Conventions [built-in] -> Indentation, select Tab policy as "space
> only". Enter a new name for this profile and click "OK".
>     2. Java -> Editor -> Typing, and check "Insert spaces for tab".
>     3. Ant -> Editor -> Formatter, and uncheck "Use tab character instead of spaces".
>     4. If you installed Colorer, Colorer Library Editor -> Uses spaces instead of tabs.
>     5. If you installed XML Buddy, XMLBuddy -> Formatting -> Uses spaces instead of tabs.
>     6. Unfortunaltely neither of the 2 main FreeMarker pluggin have similar functionnality yet. So for FTL files you have to do
that
> manually with an external editor.
> >>
>
> For point 6 I'm not sure if there is not a better way to do that in Eclipse 3, any idea ?
>
> If some have time and experience maybe we could do the same thing for at least NetBeans ?
>
> BTW,  it seems that groups.csail.mit.edu has a way to avoid finding tabs in source files : "Our Subversion repository will
actually
> reject commits that include tabs in text files, so you'd better fix this now, or face pain later.". Could that possible in Apache
> SVN ?
>
> Jacques

Reply | Threaded
Open this post in threaded view
|

Re: Spaces for tabs

Scott Gray
Hi Jacques

I use AnyEdit plugin for eclipse http://andrei.gmxhome.de/anyedit/
I just noticed their new version can show tabs and white space in the editor

Regards
Scott

Jacques Le Roux wrote:

> I just found the wonderful command Ctrl+I in Eclipse 3.2. A must to correct indentation and transform tabs to spaces after having
> set like indicated below.
>
> Is somebody aware of a command/tool in Eclipse (or even off) able to get rid of useless spaces and tabs at end of lines ?
>
> Thanks
>
> Jacques
>
> ----- Original Message -----
> From: "Jacques Le Roux" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, November 13, 2006 10:24 AM
> Subject: Spaces for tabs
>
>
>  
>> Hi all,
>>
>> Willing to ease this redundant Spaces for Tabs format problem here is a text I propose to put in
>> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices
>>
>> mixing informations from
>> http://groups.csail.mit.edu/uid/wiki/index.php?title=Getting_Started#Configure_Your_Development_Environment
>> http://cwiki.apache.org/confluence/display/GMOxDEV/Developing+Geronimo+in+Eclipse
>> http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php
>> here are some updated help to allow using spaces in place of tabs in source files in Eclipse 3.
>>
>> <<
>> We don't want tab characters in text files in SVN, because different editors and tools interpret tabs differently. All indentation
>> should be done purely with spaces.
>> To change tabs to spaces in Eclipse, change these preferences in Window -> Preferences ->
>>     1. Java -> Code Style -> Code Formatter -> Show... -> Java Conventions [built-in] -> Indentation, select Tab policy as "space
>> only". Enter a new name for this profile and click "OK".
>>     2. Java -> Editor -> Typing, and check "Insert spaces for tab".
>>     3. Ant -> Editor -> Formatter, and uncheck "Use tab character instead of spaces".
>>     4. If you installed Colorer, Colorer Library Editor -> Uses spaces instead of tabs.
>>     5. If you installed XML Buddy, XMLBuddy -> Formatting -> Uses spaces instead of tabs.
>>     6. Unfortunaltely neither of the 2 main FreeMarker pluggin have similar functionnality yet. So for FTL files you have to do
>>    
> that
>  
>> manually with an external editor.
>>    
>> For point 6 I'm not sure if there is not a better way to do that in Eclipse 3, any idea ?
>>
>> If some have time and experience maybe we could do the same thing for at least NetBeans ?
>>
>> BTW,  it seems that groups.csail.mit.edu has a way to avoid finding tabs in source files : "Our Subversion repository will
>>    
> actually
>  
>> reject commits that include tabs in text files, so you'd better fix this now, or face pain later.". Could that possible in Apache
>> SVN ?
>>
>> Jacques
>>    
>
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: Spaces for tabs

Jacques Le Roux
Administrator
Thanks a lot Scott,

This is a "must have". I recommend it warmly. Using it with Ctrl+I in Eclipse we will not have to care no more for indentation and
tabs in any files (including FTL)
I also discovered that Scite has "Strip trailing spaces" feature in Tools menu but with this plugin it's not needed anymore.

I put a comment with my previous remarks about AnyEdit in
http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions

Jacques

From: "Scott Gray"

> Hi Jacques
>
> I use AnyEdit plugin for eclipse http://andrei.gmxhome.de/anyedit/
> I just noticed their new version can show tabs and white space in the editor
>
> Regards
> Scott
>
> Jacques Le Roux wrote:
> > I just found the wonderful command Ctrl+I in Eclipse 3.2. A must to correct indentation and transform tabs to spaces after
having

> > set like indicated below.
> >
> > Is somebody aware of a command/tool in Eclipse (or even off) able to get rid of useless spaces and tabs at end of lines ?
> >
> > Thanks
> >
> > Jacques
> >
> > ----- Original Message -----
> > From: "Jacques Le Roux" <[hidden email]>
> > To: <[hidden email]>
> > Sent: Monday, November 13, 2006 10:24 AM
> > Subject: Spaces for tabs
> >
> >
> >
> >> Hi all,
> >>
> >> Willing to ease this redundant Spaces for Tabs format problem here is a text I propose to put in
> >> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices
> >>
> >> mixing informations from
> >> http://groups.csail.mit.edu/uid/wiki/index.php?title=Getting_Started#Configure_Your_Development_Environment
> >> http://cwiki.apache.org/confluence/display/GMOxDEV/Developing+Geronimo+in+Eclipse
> >> http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php
> >> here are some updated help to allow using spaces in place of tabs in source files in Eclipse 3.
> >>
> >> <<
> >> We don't want tab characters in text files in SVN, because different editors and tools interpret tabs differently. All
indentation
> >> should be done purely with spaces.
> >> To change tabs to spaces in Eclipse, change these preferences in Window -> Preferences ->
> >>     1. Java -> Code Style -> Code Formatter -> Show... -> Java Conventions [built-in] -> Indentation, select Tab policy as
"space

> >> only". Enter a new name for this profile and click "OK".
> >>     2. Java -> Editor -> Typing, and check "Insert spaces for tab".
> >>     3. Ant -> Editor -> Formatter, and uncheck "Use tab character instead of spaces".
> >>     4. If you installed Colorer, Colorer Library Editor -> Uses spaces instead of tabs.
> >>     5. If you installed XML Buddy, XMLBuddy -> Formatting -> Uses spaces instead of tabs.
> >>     6. Unfortunaltely neither of the 2 main FreeMarker pluggin have similar functionnality yet. So for FTL files you have to do
> >>
> > that
> >
> >> manually with an external editor.
> >>
> >> For point 6 I'm not sure if there is not a better way to do that in Eclipse 3, any idea ?
> >>
> >> If some have time and experience maybe we could do the same thing for at least NetBeans ?
> >>
> >> BTW,  it seems that groups.csail.mit.edu has a way to avoid finding tabs in source files : "Our Subversion repository will
> >>
> > actually
> >
> >> reject commits that include tabs in text files, so you'd better fix this now, or face pain later.". Could that possible in
Apache
> >> SVN ?
> >>
> >> Jacques
> >>
> >
> >
> >

Reply | Threaded
Open this post in threaded view
|

Re: Spaces for tabs

David E Jones-2

Just be careful with these sorts of tools...

The thing to keep in mind is that a big point of formatting things  
consistently is to avoid changes showing up in patches that are  
formatting only and that make it harder to see functionality changes.

Fixing formatting is a good thing, just be sensitive about making  
difficult to read patches more difficult with a whole bunch of  
unrelated formatting changes. Putting those in a separate commit is a  
nice thing.

-David


On Nov 13, 2006, at 11:26 PM, Jacques Le Roux wrote:

> Thanks a lot Scott,
>
> This is a "must have". I recommend it warmly. Using it with Ctrl+I  
> in Eclipse we will not have to care no more for indentation and
> tabs in any files (including FTL)
> I also discovered that Scite has "Strip trailing spaces" feature in  
> Tools menu but with this plugin it's not needed anymore.
>
> I put a comment with my previous remarks about AnyEdit in
> http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions
>
> Jacques
>
> From: "Scott Gray"
>> Hi Jacques
>>
>> I use AnyEdit plugin for eclipse http://andrei.gmxhome.de/anyedit/
>> I just noticed their new version can show tabs and white space in  
>> the editor
>>
>> Regards
>> Scott
>>
>> Jacques Le Roux wrote:
>>> I just found the wonderful command Ctrl+I in Eclipse 3.2. A must  
>>> to correct indentation and transform tabs to spaces after
> having
>>> set like indicated below.
>>>
>>> Is somebody aware of a command/tool in Eclipse (or even off) able  
>>> to get rid of useless spaces and tabs at end of lines ?
>>>
>>> Thanks
>>>
>>> Jacques
>>>
>>> ----- Original Message -----
>>> From: "Jacques Le Roux" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Monday, November 13, 2006 10:24 AM
>>> Subject: Spaces for tabs
>>>
>>>
>>>
>>>> Hi all,
>>>>
>>>> Willing to ease this redundant Spaces for Tabs format problem  
>>>> here is a text I propose to put in
>>>> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best 
>>>> +Practices
>>>>
>>>> mixing informations from
>>>> http://groups.csail.mit.edu/uid/wiki/index.php?
>>>> title=Getting_Started#Configure_Your_Development_Environment
>>>> http://cwiki.apache.org/confluence/display/GMOxDEV/Developing 
>>>> +Geronimo+in+Eclipse
>>>> http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php
>>>> here are some updated help to allow using spaces in place of  
>>>> tabs in source files in Eclipse 3.
>>>>
>>>> <<
>>>> We don't want tab characters in text files in SVN, because  
>>>> different editors and tools interpret tabs differently. All
> indentation
>>>> should be done purely with spaces.
>>>> To change tabs to spaces in Eclipse, change these preferences in  
>>>> Window -> Preferences ->
>>>>     1. Java -> Code Style -> Code Formatter -> Show... -> Java  
>>>> Conventions [built-in] -> Indentation, select Tab policy as
> "space
>>>> only". Enter a new name for this profile and click "OK".
>>>>     2. Java -> Editor -> Typing, and check "Insert spaces for tab".
>>>>     3. Ant -> Editor -> Formatter, and uncheck "Use tab  
>>>> character instead of spaces".
>>>>     4. If you installed Colorer, Colorer Library Editor -> Uses  
>>>> spaces instead of tabs.
>>>>     5. If you installed XML Buddy, XMLBuddy -> Formatting ->  
>>>> Uses spaces instead of tabs.
>>>>     6. Unfortunaltely neither of the 2 main FreeMarker pluggin  
>>>> have similar functionnality yet. So for FTL files you have to do
>>>>
>>> that
>>>
>>>> manually with an external editor.
>>>>
>>>> For point 6 I'm not sure if there is not a better way to do that  
>>>> in Eclipse 3, any idea ?
>>>>
>>>> If some have time and experience maybe we could do the same  
>>>> thing for at least NetBeans ?
>>>>
>>>> BTW,  it seems that groups.csail.mit.edu has a way to avoid  
>>>> finding tabs in source files : "Our Subversion repository will
>>>>
>>> actually
>>>
>>>> reject commits that include tabs in text files, so you'd better  
>>>> fix this now, or face pain later.". Could that possible in
> Apache
>>>> SVN ?
>>>>
>>>> Jacques
>>>>
>>>
>>>
>>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Spaces for tabs

Scott Gray
How about applying formatting changes to the patch file itself?  I just
had a go and it doesn't affect being able to apply the patch except I
had to tell subversion to ignore whitespace.  That way the only
formatting cleanups would be in the same lines as the altered code.

Regards
Scott

David E Jones wrote:

>
> Just be careful with these sorts of tools...
>
> The thing to keep in mind is that a big point of formatting things
> consistently is to avoid changes showing up in patches that are
> formatting only and that make it harder to see functionality changes.
>
> Fixing formatting is a good thing, just be sensitive about making
> difficult to read patches more difficult with a whole bunch of
> unrelated formatting changes. Putting those in a separate commit is a
> nice thing.
>
> -David
>
>
> On Nov 13, 2006, at 11:26 PM, Jacques Le Roux wrote:
>
>> Thanks a lot Scott,
>>
>> This is a "must have". I recommend it warmly. Using it with Ctrl+I in
>> Eclipse we will not have to care no more for indentation and
>> tabs in any files (including FTL)
>> I also discovered that Scite has "Strip trailing spaces" feature in
>> Tools menu but with this plugin it's not needed anymore.
>>
>> I put a comment with my previous remarks about AnyEdit in
>> http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions
>>
>> Jacques
>>
>> From: "Scott Gray"
>>> Hi Jacques
>>>
>>> I use AnyEdit plugin for eclipse http://andrei.gmxhome.de/anyedit/
>>> I just noticed their new version can show tabs and white space in
>>> the editor
>>>
>>> Regards
>>> Scott
>>>
>>> Jacques Le Roux wrote:
>>>> I just found the wonderful command Ctrl+I in Eclipse 3.2. A must to
>>>> correct indentation and transform tabs to spaces after
>> having
>>>> set like indicated below.
>>>>
>>>> Is somebody aware of a command/tool in Eclipse (or even off) able
>>>> to get rid of useless spaces and tabs at end of lines ?
>>>>
>>>> Thanks
>>>>
>>>> Jacques
>>>>
>>>> ----- Original Message -----
>>>> From: "Jacques Le Roux" <[hidden email]>
>>>> To: <[hidden email]>
>>>> Sent: Monday, November 13, 2006 10:24 AM
>>>> Subject: Spaces for tabs
>>>>
>>>>
>>>>
>>>>> Hi all,
>>>>>
>>>>> Willing to ease this redundant Spaces for Tabs format problem here
>>>>> is a text I propose to put in
>>>>> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices 
>>>>>
>>>>>
>>>>> mixing informations from
>>>>> http://groups.csail.mit.edu/uid/wiki/index.php?title=Getting_Started#Configure_Your_Development_Environment 
>>>>>
>>>>> http://cwiki.apache.org/confluence/display/GMOxDEV/Developing+Geronimo+in+Eclipse 
>>>>>
>>>>> http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php
>>>>> here are some updated help to allow using spaces in place of tabs
>>>>> in source files in Eclipse 3.
>>>>>
>>>>> <<
>>>>> We don't want tab characters in text files in SVN, because
>>>>> different editors and tools interpret tabs differently. All
>> indentation
>>>>> should be done purely with spaces.
>>>>> To change tabs to spaces in Eclipse, change these preferences in
>>>>> Window -> Preferences ->
>>>>>     1. Java -> Code Style -> Code Formatter -> Show... -> Java
>>>>> Conventions [built-in] -> Indentation, select Tab policy as
>> "space
>>>>> only". Enter a new name for this profile and click "OK".
>>>>>     2. Java -> Editor -> Typing, and check "Insert spaces for tab".
>>>>>     3. Ant -> Editor -> Formatter, and uncheck "Use tab character
>>>>> instead of spaces".
>>>>>     4. If you installed Colorer, Colorer Library Editor -> Uses
>>>>> spaces instead of tabs.
>>>>>     5. If you installed XML Buddy, XMLBuddy -> Formatting -> Uses
>>>>> spaces instead of tabs.
>>>>>     6. Unfortunaltely neither of the 2 main FreeMarker pluggin
>>>>> have similar functionnality yet. So for FTL files you have to do
>>>>>
>>>> that
>>>>
>>>>> manually with an external editor.
>>>>>
>>>>> For point 6 I'm not sure if there is not a better way to do that
>>>>> in Eclipse 3, any idea ?
>>>>>
>>>>> If some have time and experience maybe we could do the same thing
>>>>> for at least NetBeans ?
>>>>>
>>>>> BTW,  it seems that groups.csail.mit.edu has a way to avoid
>>>>> finding tabs in source files : "Our Subversion repository will
>>>>>
>>>> actually
>>>>
>>>>> reject commits that include tabs in text files, so you'd better
>>>>> fix this now, or face pain later.". Could that possible in
>> Apache
>>>>> SVN ?
>>>>>
>>>>> Jacques
>>>>>
>>>>
>>>>
>>>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Spaces for tabs

Jacques Le Roux
Administrator
In reply to this post by David E Jones-2
David,

So the policy might be to use this tools only when creating new files and not when "patching" them ?

I may change my comment in http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions accordingly.

Jacques

From: "David E Jones" <[hidden email]>

>
> Just be careful with these sorts of tools...
>
> The thing to keep in mind is that a big point of formatting things  
> consistently is to avoid changes showing up in patches that are  
> formatting only and that make it harder to see functionality changes.
>
> Fixing formatting is a good thing, just be sensitive about making  
> difficult to read patches more difficult with a whole bunch of  
> unrelated formatting changes. Putting those in a separate commit is a  
> nice thing.
>
> -David
>
>
> On Nov 13, 2006, at 11:26 PM, Jacques Le Roux wrote:
>
> > Thanks a lot Scott,
> >
> > This is a "must have". I recommend it warmly. Using it with Ctrl+I  
> > in Eclipse we will not have to care no more for indentation and
> > tabs in any files (including FTL)
> > I also discovered that Scite has "Strip trailing spaces" feature in  
> > Tools menu but with this plugin it's not needed anymore.
> >
> > I put a comment with my previous remarks about AnyEdit in
> > http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions
> >
> > Jacques
> >
> > From: "Scott Gray"
> >> Hi Jacques
> >>
> >> I use AnyEdit plugin for eclipse http://andrei.gmxhome.de/anyedit/
> >> I just noticed their new version can show tabs and white space in  
> >> the editor
> >>
> >> Regards
> >> Scott
> >>
> >> Jacques Le Roux wrote:
> >>> I just found the wonderful command Ctrl+I in Eclipse 3.2. A must  
> >>> to correct indentation and transform tabs to spaces after
> > having
> >>> set like indicated below.
> >>>
> >>> Is somebody aware of a command/tool in Eclipse (or even off) able  
> >>> to get rid of useless spaces and tabs at end of lines ?
> >>>
> >>> Thanks
> >>>
> >>> Jacques
> >>>
> >>> ----- Original Message -----
> >>> From: "Jacques Le Roux" <[hidden email]>
> >>> To: <[hidden email]>
> >>> Sent: Monday, November 13, 2006 10:24 AM
> >>> Subject: Spaces for tabs
> >>>
> >>>
> >>>
> >>>> Hi all,
> >>>>
> >>>> Willing to ease this redundant Spaces for Tabs format problem  
> >>>> here is a text I propose to put in
> >>>> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best 
> >>>> +Practices
> >>>>
> >>>> mixing informations from
> >>>> http://groups.csail.mit.edu/uid/wiki/index.php?
> >>>> title=Getting_Started#Configure_Your_Development_Environment
> >>>> http://cwiki.apache.org/confluence/display/GMOxDEV/Developing 
> >>>> +Geronimo+in+Eclipse
> >>>> http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php
> >>>> here are some updated help to allow using spaces in place of  
> >>>> tabs in source files in Eclipse 3.
> >>>>
> >>>> <<
> >>>> We don't want tab characters in text files in SVN, because  
> >>>> different editors and tools interpret tabs differently. All
> > indentation
> >>>> should be done purely with spaces.
> >>>> To change tabs to spaces in Eclipse, change these preferences in  
> >>>> Window -> Preferences ->
> >>>>     1. Java -> Code Style -> Code Formatter -> Show... -> Java  
> >>>> Conventions [built-in] -> Indentation, select Tab policy as
> > "space
> >>>> only". Enter a new name for this profile and click "OK".
> >>>>     2. Java -> Editor -> Typing, and check "Insert spaces for tab".
> >>>>     3. Ant -> Editor -> Formatter, and uncheck "Use tab  
> >>>> character instead of spaces".
> >>>>     4. If you installed Colorer, Colorer Library Editor -> Uses  
> >>>> spaces instead of tabs.
> >>>>     5. If you installed XML Buddy, XMLBuddy -> Formatting ->  
> >>>> Uses spaces instead of tabs.
> >>>>     6. Unfortunaltely neither of the 2 main FreeMarker pluggin  
> >>>> have similar functionnality yet. So for FTL files you have to do
> >>>>
> >>> that
> >>>
> >>>> manually with an external editor.
> >>>>
> >>>> For point 6 I'm not sure if there is not a better way to do that  
> >>>> in Eclipse 3, any idea ?
> >>>>
> >>>> If some have time and experience maybe we could do the same  
> >>>> thing for at least NetBeans ?
> >>>>
> >>>> BTW,  it seems that groups.csail.mit.edu has a way to avoid  
> >>>> finding tabs in source files : "Our Subversion repository will
> >>>>
> >>> actually
> >>>
> >>>> reject commits that include tabs in text files, so you'd better  
> >>>> fix this now, or face pain later.". Could that possible in
> > Apache
> >>>> SVN ?
> >>>>
> >>>> Jacques
> >>>>
> >>>
> >>>
> >>>
> >
Reply | Threaded
Open this post in threaded view
|

Re: Spaces for tabs

Jacques Le Roux
Administrator
David,

I finally made this recommendation in my comment :
http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions?focusedCommentId=698#comment-698

Thanks to have scrutinized this, team work experience I guess ;o)

Jacques

----- Original Message -----
From: "Jacques Le Roux" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, November 14, 2006 8:41 AM
Subject: Re: Spaces for tabs


> David,
>
> So the policy might be to use this tools only when creating new files and not when "patching" them ?
>
> I may change my comment in http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions accordingly.
>
> Jacques
>
> From: "David E Jones" <[hidden email]>
> >
> > Just be careful with these sorts of tools...
> >
> > The thing to keep in mind is that a big point of formatting things
> > consistently is to avoid changes showing up in patches that are
> > formatting only and that make it harder to see functionality changes.
> >
> > Fixing formatting is a good thing, just be sensitive about making
> > difficult to read patches more difficult with a whole bunch of
> > unrelated formatting changes. Putting those in a separate commit is a
> > nice thing.
> >
> > -David
> >
> >
> > On Nov 13, 2006, at 11:26 PM, Jacques Le Roux wrote:
> >
> > > Thanks a lot Scott,
> > >
> > > This is a "must have". I recommend it warmly. Using it with Ctrl+I
> > > in Eclipse we will not have to care no more for indentation and
> > > tabs in any files (including FTL)
> > > I also discovered that Scite has "Strip trailing spaces" feature in
> > > Tools menu but with this plugin it's not needed anymore.
> > >
> > > I put a comment with my previous remarks about AnyEdit in
> > > http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions
> > >
> > > Jacques
> > >
> > > From: "Scott Gray"
> > >> Hi Jacques
> > >>
> > >> I use AnyEdit plugin for eclipse http://andrei.gmxhome.de/anyedit/
> > >> I just noticed their new version can show tabs and white space in
> > >> the editor
> > >>
> > >> Regards
> > >> Scott
> > >>
> > >> Jacques Le Roux wrote:
> > >>> I just found the wonderful command Ctrl+I in Eclipse 3.2. A must
> > >>> to correct indentation and transform tabs to spaces after
> > > having
> > >>> set like indicated below.
> > >>>
> > >>> Is somebody aware of a command/tool in Eclipse (or even off) able
> > >>> to get rid of useless spaces and tabs at end of lines ?
> > >>>
> > >>> Thanks
> > >>>
> > >>> Jacques
> > >>>
> > >>> ----- Original Message -----
> > >>> From: "Jacques Le Roux" <[hidden email]>
> > >>> To: <[hidden email]>
> > >>> Sent: Monday, November 13, 2006 10:24 AM
> > >>> Subject: Spaces for tabs
> > >>>
> > >>>
> > >>>
> > >>>> Hi all,
> > >>>>
> > >>>> Willing to ease this redundant Spaces for Tabs format problem
> > >>>> here is a text I propose to put in
> > >>>> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best
> > >>>> +Practices
> > >>>>
> > >>>> mixing informations from
> > >>>> http://groups.csail.mit.edu/uid/wiki/index.php?
> > >>>> title=Getting_Started#Configure_Your_Development_Environment
> > >>>> http://cwiki.apache.org/confluence/display/GMOxDEV/Developing
> > >>>> +Geronimo+in+Eclipse
> > >>>> http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php
> > >>>> here are some updated help to allow using spaces in place of
> > >>>> tabs in source files in Eclipse 3.
> > >>>>
> > >>>> <<
> > >>>> We don't want tab characters in text files in SVN, because
> > >>>> different editors and tools interpret tabs differently. All
> > > indentation
> > >>>> should be done purely with spaces.
> > >>>> To change tabs to spaces in Eclipse, change these preferences in
> > >>>> Window -> Preferences ->
> > >>>>     1. Java -> Code Style -> Code Formatter -> Show... -> Java
> > >>>> Conventions [built-in] -> Indentation, select Tab policy as
> > > "space
> > >>>> only". Enter a new name for this profile and click "OK".
> > >>>>     2. Java -> Editor -> Typing, and check "Insert spaces for tab".
> > >>>>     3. Ant -> Editor -> Formatter, and uncheck "Use tab
> > >>>> character instead of spaces".
> > >>>>     4. If you installed Colorer, Colorer Library Editor -> Uses
> > >>>> spaces instead of tabs.
> > >>>>     5. If you installed XML Buddy, XMLBuddy -> Formatting ->
> > >>>> Uses spaces instead of tabs.
> > >>>>     6. Unfortunaltely neither of the 2 main FreeMarker pluggin
> > >>>> have similar functionnality yet. So for FTL files you have to do
> > >>>>
> > >>> that
> > >>>
> > >>>> manually with an external editor.
> > >>>>
> > >>>> For point 6 I'm not sure if there is not a better way to do that
> > >>>> in Eclipse 3, any idea ?
> > >>>>
> > >>>> If some have time and experience maybe we could do the same
> > >>>> thing for at least NetBeans ?
> > >>>>
> > >>>> BTW,  it seems that groups.csail.mit.edu has a way to avoid
> > >>>> finding tabs in source files : "Our Subversion repository will
> > >>>>
> > >>> actually
> > >>>
> > >>>> reject commits that include tabs in text files, so you'd better
> > >>>> fix this now, or face pain later.". Could that possible in
> > > Apache
> > >>>> SVN ?
> > >>>>
> > >>>> Jacques
> > >>>>
> > >>>
> > >>>
> > >>>
> > >

Reply | Threaded
Open this post in threaded view
|

Re: Spaces for tabs

David E Jones-2

Jacques,

Could you re-read my original comments? Copied here:

>> Just be careful with these sorts of tools...
>>
>> The thing to keep in mind is that a big point of formatting things
>> consistently is to avoid changes showing up in patches that are
>> formatting only and that make it harder to see functionality changes.
>>
>> Fixing formatting is a good thing, just be sensitive about making
>> difficult to read patches more difficult with a whole bunch of
>> unrelated formatting changes. Putting those in a separate commit is a
>> nice thing.

What I said was use them, but use them carefully and considerately  
and be aware of why they are good/bad and what their impact can/will be.

As for formatting patches: I wouldn't recommend it. Anything that  
splits or combines lines is guaranteed to mess up a patch, and if  
something is more context aware (ie beyond tabs to spaces sorts of  
things) they can cause problem in the unified patch headers and such.

-David


On Nov 14, 2006, at 2:08 PM, Jacques Le Roux wrote:

> David,
>
> I finally made this recommendation in my comment :
> http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions?
> focusedCommentId=698#comment-698
>
> Thanks to have scrutinized this, team work experience I guess ;o)
>
> Jacques
>
> ----- Original Message -----
> From: "Jacques Le Roux" <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, November 14, 2006 8:41 AM
> Subject: Re: Spaces for tabs
>
>
>> David,
>>
>> So the policy might be to use this tools only when creating new  
>> files and not when "patching" them ?
>>
>> I may change my comment in http://docs.ofbiz.org/display/OFBADMIN/ 
>> Coding+Conventions accordingly.
>>
>> Jacques
>>
>> From: "David E Jones" <[hidden email]>
>>>
>>> Just be careful with these sorts of tools...
>>>
>>> The thing to keep in mind is that a big point of formatting things
>>> consistently is to avoid changes showing up in patches that are
>>> formatting only and that make it harder to see functionality  
>>> changes.
>>>
>>> Fixing formatting is a good thing, just be sensitive about making
>>> difficult to read patches more difficult with a whole bunch of
>>> unrelated formatting changes. Putting those in a separate commit  
>>> is a
>>> nice thing.
>>>
>>> -David
>>>
>>>
>>> On Nov 13, 2006, at 11:26 PM, Jacques Le Roux wrote:
>>>
>>>> Thanks a lot Scott,
>>>>
>>>> This is a "must have". I recommend it warmly. Using it with Ctrl+I
>>>> in Eclipse we will not have to care no more for indentation and
>>>> tabs in any files (including FTL)
>>>> I also discovered that Scite has "Strip trailing spaces" feature in
>>>> Tools menu but with this plugin it's not needed anymore.
>>>>
>>>> I put a comment with my previous remarks about AnyEdit in
>>>> http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions
>>>>
>>>> Jacques
>>>>
>>>> From: "Scott Gray"
>>>>> Hi Jacques
>>>>>
>>>>> I use AnyEdit plugin for eclipse http://andrei.gmxhome.de/anyedit/
>>>>> I just noticed their new version can show tabs and white space in
>>>>> the editor
>>>>>
>>>>> Regards
>>>>> Scott
>>>>>
>>>>> Jacques Le Roux wrote:
>>>>>> I just found the wonderful command Ctrl+I in Eclipse 3.2. A must
>>>>>> to correct indentation and transform tabs to spaces after
>>>> having
>>>>>> set like indicated below.
>>>>>>
>>>>>> Is somebody aware of a command/tool in Eclipse (or even off) able
>>>>>> to get rid of useless spaces and tabs at end of lines ?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Jacques
>>>>>>
>>>>>> ----- Original Message -----
>>>>>> From: "Jacques Le Roux" <[hidden email]>
>>>>>> To: <[hidden email]>
>>>>>> Sent: Monday, November 13, 2006 10:24 AM
>>>>>> Subject: Spaces for tabs
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> Willing to ease this redundant Spaces for Tabs format problem
>>>>>>> here is a text I propose to put in
>>>>>>> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best
>>>>>>> +Practices
>>>>>>>
>>>>>>> mixing informations from
>>>>>>> http://groups.csail.mit.edu/uid/wiki/index.php?
>>>>>>> title=Getting_Started#Configure_Your_Development_Environment
>>>>>>> http://cwiki.apache.org/confluence/display/GMOxDEV/Developing
>>>>>>> +Geronimo+in+Eclipse
>>>>>>> http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php
>>>>>>> here are some updated help to allow using spaces in place of
>>>>>>> tabs in source files in Eclipse 3.
>>>>>>>
>>>>>>> <<
>>>>>>> We don't want tab characters in text files in SVN, because
>>>>>>> different editors and tools interpret tabs differently. All
>>>> indentation
>>>>>>> should be done purely with spaces.
>>>>>>> To change tabs to spaces in Eclipse, change these preferences in
>>>>>>> Window -> Preferences ->
>>>>>>>     1. Java -> Code Style -> Code Formatter -> Show... -> Java
>>>>>>> Conventions [built-in] -> Indentation, select Tab policy as
>>>> "space
>>>>>>> only". Enter a new name for this profile and click "OK".
>>>>>>>     2. Java -> Editor -> Typing, and check "Insert spaces for  
>>>>>>> tab".
>>>>>>>     3. Ant -> Editor -> Formatter, and uncheck "Use tab
>>>>>>> character instead of spaces".
>>>>>>>     4. If you installed Colorer, Colorer Library Editor -> Uses
>>>>>>> spaces instead of tabs.
>>>>>>>     5. If you installed XML Buddy, XMLBuddy -> Formatting ->
>>>>>>> Uses spaces instead of tabs.
>>>>>>>     6. Unfortunaltely neither of the 2 main FreeMarker pluggin
>>>>>>> have similar functionnality yet. So for FTL files you have to do
>>>>>>>
>>>>>> that
>>>>>>
>>>>>>> manually with an external editor.
>>>>>>>
>>>>>>> For point 6 I'm not sure if there is not a better way to do that
>>>>>>> in Eclipse 3, any idea ?
>>>>>>>
>>>>>>> If some have time and experience maybe we could do the same
>>>>>>> thing for at least NetBeans ?
>>>>>>>
>>>>>>> BTW,  it seems that groups.csail.mit.edu has a way to avoid
>>>>>>> finding tabs in source files : "Our Subversion repository will
>>>>>>>
>>>>>> actually
>>>>>>
>>>>>>> reject commits that include tabs in text files, so you'd better
>>>>>>> fix this now, or face pain later.". Could that possible in
>>>> Apache
>>>>>>> SVN ?
>>>>>>>
>>>>>>> Jacques
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>