You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Alexei Zakharov <al...@gmail.com> on 2006/10/02 17:54:21 UTC
[classlib] removing \t from sources
Hi all,
I noticed that the tab character (0x09) is still widely used in our
classlib source code. At least in tests. From my recent experience
this leads to broken indentation. I mean the situation when patch with
spaces is applied to the source there tab character is used for
indentation. Someone knows that according to Sun code conventions the
tab should be exactly 8 spaces. The other person knows that exactly
four spaces should be used as the unit of indentation [1]. As a result
we have all methods indented with the single tab character and the
patched methods indented with 4 spaces. And if your IDE is configured
to display tabs as 8 spaces you will see broken indentation. Or vice
versa.
I have created small ANT script - see HARMONY-1660 [2]. This script
converts all tabs to spaces in all found sources under the given
directory recursively. I will be grateful if someone runs this script
(tab -> 4 spaces) at least for beans tests (I currently working with)
and integrates the results. It is really painful to deal with this
broken alignment every day. And it is too boring (and IMHO silly) to
convert it file by file and send patches for each case.
[1] http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#262
[3] http://issues.apache.org/jira/browse/HARMONY-1660
Thanks,
--
Alexei Zakharov,
Intel Middleware Product Division
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [classlib] removing \t from sources
Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
+1 to the concept - if the patch works, +1 from me... \t is evil :)
Alexei Zakharov wrote:
> Hi all,
>
> I noticed that the tab character (0x09) is still widely used in our
> classlib source code. At least in tests. From my recent experience
> this leads to broken indentation. I mean the situation when patch with
> spaces is applied to the source there tab character is used for
> indentation. Someone knows that according to Sun code conventions the
> tab should be exactly 8 spaces. The other person knows that exactly
> four spaces should be used as the unit of indentation [1]. As a result
> we have all methods indented with the single tab character and the
> patched methods indented with 4 spaces. And if your IDE is configured
> to display tabs as 8 spaces you will see broken indentation. Or vice
> versa.
>
> I have created small ANT script - see HARMONY-1660 [2]. This script
> converts all tabs to spaces in all found sources under the given
> directory recursively. I will be grateful if someone runs this script
> (tab -> 4 spaces) at least for beans tests (I currently working with)
> and integrates the results. It is really painful to deal with this
> broken alignment every day. And it is too boring (and IMHO silly) to
> convert it file by file and send patches for each case.
>
> [1] http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#262
> [3] http://issues.apache.org/jira/browse/HARMONY-1660
>
> Thanks,
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [classlib] removing \t from sources
Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
On Dec 30, 2006, at 8:43 AM, Thorbjørn Ravn Andersen wrote:
> Geir Magnusson Jr. skrev den 03-10-2006 13:12:
>> No matter what, tabs shouldn't be used. They make it impossible
>> to portably represent the formatting.
>>
> Reading up on old stuff I found this, and wondered if the
> subversion server could reject ascii files with tabs in it, or a
> script be run in the tests that verifies that no sources contain tabs?
Maybe, but it hasn't been a major problem so far. I think people
configure their editors once, and that's that.
geir
Re: [classlib] removing \t from sources
Posted by Thorbjørn Ravn Andersen <th...@gmail.com>.
Geir Magnusson Jr. skrev den 03-10-2006 13:12:
> No matter what, tabs shouldn't be used. They make it impossible to
> portably represent the formatting.
>
Reading up on old stuff I found this, and wondered if the subversion
server could reject ascii files with tabs in it, or a script be run in
the tests that verifies that no sources contain tabs?
--
Thorbjørn
Re: [classlib] removing \t from sources
Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
No matter what, tabs shouldn't be used. They make it impossible to
portably represent the formatting.
geir
Alexei Zakharov wrote:
> I see. This IMHO is another argument why \t is bad. My script will not
> be able to handle this, it just replaces one string pattern with
> another. So such cases should be handled manually or with the code
> formatter. However, the drawback of the code formatter is that it
> removes the "author's personality" from the code.
>
> But IMHO mixing spaces with tabs in the single unit of indentation is
> even worse than just using tabs. Normally people use either tabs or
> spaces. I suppose that mixes appear when the original source with tabs
> is being edited with IDE configured to use spaces. I haven't seen many
> of such cases in HY code, at least in the modules I worked with.
>
> With best regards,
>
> 2006/10/2, Alexey Petrenko <al...@gmail.com>:
>> I mean that {"space", "space", "tab"} will be converted to the same
>> number of spaces as simple tab by the most of editors.
>>
>> SY, Alexey
>>
>> 2006/10/2, Alexei Zakharov <al...@gmail.com>:
>> > What do you mean? Convert " \t" to something? If so please see the
>> > new fully customized version of my mega-script :-)
>> >
>> > The usage pattern in your case will be:
>> > ant -f tabs2spaces_v2.xml -Dsrc.dir=<dir with sources> -Dpattern=" \t"
>> >
>> > Regards,
>> >
>> > 2006/10/2, Alexey Petrenko <al...@gmail.com>:
>> > > Does it work with the sequences like {"space", "space", "tab"} etc?
>> > >
>> > > 2006/10/2, Alexei Zakharov <al...@gmail.com>:
>> > > > Hi all,
>> > > >
>> > > > I noticed that the tab character (0x09) is still widely used in our
>> > > > classlib source code. At least in tests. From my recent experience
>> > > > this leads to broken indentation. I mean the situation when
>> patch with
>> > > > spaces is applied to the source there tab character is used for
>> > > > indentation. Someone knows that according to Sun code
>> conventions the
>> > > > tab should be exactly 8 spaces. The other person knows that exactly
>> > > > four spaces should be used as the unit of indentation [1]. As a
>> result
>> > > > we have all methods indented with the single tab character and the
>> > > > patched methods indented with 4 spaces. And if your IDE is
>> configured
>> > > > to display tabs as 8 spaces you will see broken indentation. Or
>> vice
>> > > > versa.
>> > > >
>> > > > I have created small ANT script - see HARMONY-1660 [2]. This script
>> > > > converts all tabs to spaces in all found sources under the given
>> > > > directory recursively. I will be grateful if someone runs this
>> script
>> > > > (tab -> 4 spaces) at least for beans tests (I currently working
>> with)
>> > > > and integrates the results. It is really painful to deal with this
>> > > > broken alignment every day. And it is too boring (and IMHO
>> silly) to
>> > > > convert it file by file and send patches for each case.
>> > > >
>> > > > [1]
>> http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#262
>> > > > [3] http://issues.apache.org/jira/browse/HARMONY-1660
>> > > >
>> > > > Thanks,
>
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [classlib] removing \t from sources
Posted by Alexei Zakharov <al...@gmail.com>.
Thanks, Tim :-)
Regards,
2006/10/3, Tim Ellison <t....@gmail.com>:
> I've committed the reformatted code in r452415.
>
> Now you can feel calm again :-)
>
> The other modules are being cleaned-up piece by piece.
>
> Regards,
> Tim
>
> Alexei Zakharov wrote:
> > I see. This IMHO is another argument why \t is bad. My script will not
> > be able to handle this, it just replaces one string pattern with
> > another. So such cases should be handled manually or with the code
> > formatter. However, the drawback of the code formatter is that it
> > removes the "author's personality" from the code.
> >
> > But IMHO mixing spaces with tabs in the single unit of indentation is
> > even worse than just using tabs. Normally people use either tabs or
> > spaces. I suppose that mixes appear when the original source with tabs
> > is being edited with IDE configured to use spaces. I haven't seen many
> > of such cases in HY code, at least in the modules I worked with.
> >
> > With best regards,
> >
> > 2006/10/2, Alexey Petrenko <al...@gmail.com>:
> >> I mean that {"space", "space", "tab"} will be converted to the same
> >> number of spaces as simple tab by the most of editors.
> >>
> >> SY, Alexey
> >>
> >> 2006/10/2, Alexei Zakharov <al...@gmail.com>:
> >> > What do you mean? Convert " \t" to something? If so please see the
> >> > new fully customized version of my mega-script :-)
> >> >
> >> > The usage pattern in your case will be:
> >> > ant -f tabs2spaces_v2.xml -Dsrc.dir=<dir with sources> -Dpattern=" \t"
> >> >
> >> > Regards,
> >> >
> >> > 2006/10/2, Alexey Petrenko <al...@gmail.com>:
> >> > > Does it work with the sequences like {"space", "space", "tab"} etc?
> >> > >
> >> > > 2006/10/2, Alexei Zakharov <al...@gmail.com>:
> >> > > > Hi all,
> >> > > >
> >> > > > I noticed that the tab character (0x09) is still widely used in our
> >> > > > classlib source code. At least in tests. From my recent experience
> >> > > > this leads to broken indentation. I mean the situation when
> >> patch with
> >> > > > spaces is applied to the source there tab character is used for
> >> > > > indentation. Someone knows that according to Sun code
> >> conventions the
> >> > > > tab should be exactly 8 spaces. The other person knows that exactly
> >> > > > four spaces should be used as the unit of indentation [1]. As a
> >> result
> >> > > > we have all methods indented with the single tab character and the
> >> > > > patched methods indented with 4 spaces. And if your IDE is
> >> configured
> >> > > > to display tabs as 8 spaces you will see broken indentation. Or
> >> vice
> >> > > > versa.
> >> > > >
> >> > > > I have created small ANT script - see HARMONY-1660 [2]. This script
> >> > > > converts all tabs to spaces in all found sources under the given
> >> > > > directory recursively. I will be grateful if someone runs this
> >> script
> >> > > > (tab -> 4 spaces) at least for beans tests (I currently working
> >> with)
> >> > > > and integrates the results. It is really painful to deal with this
> >> > > > broken alignment every day. And it is too boring (and IMHO
> >> silly) to
> >> > > > convert it file by file and send patches for each case.
> >> > > >
> >> > > > [1]
> >> http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#262
> >> > > > [3] http://issues.apache.org/jira/browse/HARMONY-1660
> >> > > >
> >> > > > Thanks,
--
Alexei Zakharov,
Intel Middleware Product Division
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [classlib] removing \t from sources
Posted by Tim Ellison <t....@gmail.com>.
I've committed the reformatted code in r452415.
Now you can feel calm again :-)
The other modules are being cleaned-up piece by piece.
Regards,
Tim
Alexei Zakharov wrote:
> I see. This IMHO is another argument why \t is bad. My script will not
> be able to handle this, it just replaces one string pattern with
> another. So such cases should be handled manually or with the code
> formatter. However, the drawback of the code formatter is that it
> removes the "author's personality" from the code.
>
> But IMHO mixing spaces with tabs in the single unit of indentation is
> even worse than just using tabs. Normally people use either tabs or
> spaces. I suppose that mixes appear when the original source with tabs
> is being edited with IDE configured to use spaces. I haven't seen many
> of such cases in HY code, at least in the modules I worked with.
>
> With best regards,
>
> 2006/10/2, Alexey Petrenko <al...@gmail.com>:
>> I mean that {"space", "space", "tab"} will be converted to the same
>> number of spaces as simple tab by the most of editors.
>>
>> SY, Alexey
>>
>> 2006/10/2, Alexei Zakharov <al...@gmail.com>:
>> > What do you mean? Convert " \t" to something? If so please see the
>> > new fully customized version of my mega-script :-)
>> >
>> > The usage pattern in your case will be:
>> > ant -f tabs2spaces_v2.xml -Dsrc.dir=<dir with sources> -Dpattern=" \t"
>> >
>> > Regards,
>> >
>> > 2006/10/2, Alexey Petrenko <al...@gmail.com>:
>> > > Does it work with the sequences like {"space", "space", "tab"} etc?
>> > >
>> > > 2006/10/2, Alexei Zakharov <al...@gmail.com>:
>> > > > Hi all,
>> > > >
>> > > > I noticed that the tab character (0x09) is still widely used in our
>> > > > classlib source code. At least in tests. From my recent experience
>> > > > this leads to broken indentation. I mean the situation when
>> patch with
>> > > > spaces is applied to the source there tab character is used for
>> > > > indentation. Someone knows that according to Sun code
>> conventions the
>> > > > tab should be exactly 8 spaces. The other person knows that exactly
>> > > > four spaces should be used as the unit of indentation [1]. As a
>> result
>> > > > we have all methods indented with the single tab character and the
>> > > > patched methods indented with 4 spaces. And if your IDE is
>> configured
>> > > > to display tabs as 8 spaces you will see broken indentation. Or
>> vice
>> > > > versa.
>> > > >
>> > > > I have created small ANT script - see HARMONY-1660 [2]. This script
>> > > > converts all tabs to spaces in all found sources under the given
>> > > > directory recursively. I will be grateful if someone runs this
>> script
>> > > > (tab -> 4 spaces) at least for beans tests (I currently working
>> with)
>> > > > and integrates the results. It is really painful to deal with this
>> > > > broken alignment every day. And it is too boring (and IMHO
>> silly) to
>> > > > convert it file by file and send patches for each case.
>> > > >
>> > > > [1]
>> http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#262
>> > > > [3] http://issues.apache.org/jira/browse/HARMONY-1660
>> > > >
>> > > > Thanks,
>
--
Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [classlib] removing \t from sources
Posted by Alexei Zakharov <al...@gmail.com>.
I see. This IMHO is another argument why \t is bad. My script will not
be able to handle this, it just replaces one string pattern with
another. So such cases should be handled manually or with the code
formatter. However, the drawback of the code formatter is that it
removes the "author's personality" from the code.
But IMHO mixing spaces with tabs in the single unit of indentation is
even worse than just using tabs. Normally people use either tabs or
spaces. I suppose that mixes appear when the original source with tabs
is being edited with IDE configured to use spaces. I haven't seen many
of such cases in HY code, at least in the modules I worked with.
With best regards,
2006/10/2, Alexey Petrenko <al...@gmail.com>:
> I mean that {"space", "space", "tab"} will be converted to the same
> number of spaces as simple tab by the most of editors.
>
> SY, Alexey
>
> 2006/10/2, Alexei Zakharov <al...@gmail.com>:
> > What do you mean? Convert " \t" to something? If so please see the
> > new fully customized version of my mega-script :-)
> >
> > The usage pattern in your case will be:
> > ant -f tabs2spaces_v2.xml -Dsrc.dir=<dir with sources> -Dpattern=" \t"
> >
> > Regards,
> >
> > 2006/10/2, Alexey Petrenko <al...@gmail.com>:
> > > Does it work with the sequences like {"space", "space", "tab"} etc?
> > >
> > > 2006/10/2, Alexei Zakharov <al...@gmail.com>:
> > > > Hi all,
> > > >
> > > > I noticed that the tab character (0x09) is still widely used in our
> > > > classlib source code. At least in tests. From my recent experience
> > > > this leads to broken indentation. I mean the situation when patch with
> > > > spaces is applied to the source there tab character is used for
> > > > indentation. Someone knows that according to Sun code conventions the
> > > > tab should be exactly 8 spaces. The other person knows that exactly
> > > > four spaces should be used as the unit of indentation [1]. As a result
> > > > we have all methods indented with the single tab character and the
> > > > patched methods indented with 4 spaces. And if your IDE is configured
> > > > to display tabs as 8 spaces you will see broken indentation. Or vice
> > > > versa.
> > > >
> > > > I have created small ANT script - see HARMONY-1660 [2]. This script
> > > > converts all tabs to spaces in all found sources under the given
> > > > directory recursively. I will be grateful if someone runs this script
> > > > (tab -> 4 spaces) at least for beans tests (I currently working with)
> > > > and integrates the results. It is really painful to deal with this
> > > > broken alignment every day. And it is too boring (and IMHO silly) to
> > > > convert it file by file and send patches for each case.
> > > >
> > > > [1] http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#262
> > > > [3] http://issues.apache.org/jira/browse/HARMONY-1660
> > > >
> > > > Thanks,
--
Alexei Zakharov,
Intel Middleware Product Division
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [classlib] removing \t from sources
Posted by Alexei Zakharov <al...@gmail.com>.
Yes, I am really upset. Code formater is ok, any means are good. :)
Thanks.
2006/10/2, Tim Ellison <t....@gmail.com>:
> if it is upsetting you so much, I'll run the code formatter over beans
> tests -- that will do the whitespace replacements. We have been
> replacing them incrementally to date.
>
> Not a slur on your script you know.
>
> Regards
> Tim
>
> Alexey Petrenko wrote:
> > I mean that {"space", "space", "tab"} will be converted to the same
> > number of spaces as simple tab by the most of editors.
> >
> > SY, Alexey
> >
> > 2006/10/2, Alexei Zakharov <al...@gmail.com>:
> >> What do you mean? Convert " \t" to something? If so please see the
> >> new fully customized version of my mega-script :-)
> >>
> >> The usage pattern in your case will be:
> >> ant -f tabs2spaces_v2.xml -Dsrc.dir=<dir with sources> -Dpattern=" \t"
> >>
> >> Regards,
> >>
> >> 2006/10/2, Alexey Petrenko <al...@gmail.com>:
> >> > Does it work with the sequences like {"space", "space", "tab"} etc?
> >> >
> >> > 2006/10/2, Alexei Zakharov <al...@gmail.com>:
> >> > > Hi all,
> >> > >
> >> > > I noticed that the tab character (0x09) is still widely used in our
> >> > > classlib source code. At least in tests. From my recent experience
> >> > > this leads to broken indentation. I mean the situation when patch
> >> with
> >> > > spaces is applied to the source there tab character is used for
> >> > > indentation. Someone knows that according to Sun code conventions the
> >> > > tab should be exactly 8 spaces. The other person knows that exactly
> >> > > four spaces should be used as the unit of indentation [1]. As a
> >> result
> >> > > we have all methods indented with the single tab character and the
> >> > > patched methods indented with 4 spaces. And if your IDE is configured
> >> > > to display tabs as 8 spaces you will see broken indentation. Or vice
> >> > > versa.
> >> > >
> >> > > I have created small ANT script - see HARMONY-1660 [2]. This script
> >> > > converts all tabs to spaces in all found sources under the given
> >> > > directory recursively. I will be grateful if someone runs this script
> >> > > (tab -> 4 spaces) at least for beans tests (I currently working with)
> >> > > and integrates the results. It is really painful to deal with this
> >> > > broken alignment every day. And it is too boring (and IMHO silly) to
> >> > > convert it file by file and send patches for each case.
> >> > >
> >> > > [1]
> >> http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#262
> >> > > [3] http://issues.apache.org/jira/browse/HARMONY-1660
> >> > >
> >> > > Thanks,
> >>
> >> --
> >> Alexei Zakharov,
> >> Intel Middleware Product Division
> >>
> >> ---------------------------------------------------------------------
> >> Terms of use : http://incubator.apache.org/harmony/mailing.html
> >> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> >> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >>
> >>
> >
> >
>
> --
>
> Tim Ellison (t.p.ellison@gmail.com)
> IBM Java technology centre, UK.
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>
--
Alexei Zakharov,
Intel Middleware Product Division
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [classlib] removing \t from sources
Posted by Tim Ellison <t....@gmail.com>.
if it is upsetting you so much, I'll run the code formatter over beans
tests -- that will do the whitespace replacements. We have been
replacing them incrementally to date.
Not a slur on your script you know.
Regards
Tim
Alexey Petrenko wrote:
> I mean that {"space", "space", "tab"} will be converted to the same
> number of spaces as simple tab by the most of editors.
>
> SY, Alexey
>
> 2006/10/2, Alexei Zakharov <al...@gmail.com>:
>> What do you mean? Convert " \t" to something? If so please see the
>> new fully customized version of my mega-script :-)
>>
>> The usage pattern in your case will be:
>> ant -f tabs2spaces_v2.xml -Dsrc.dir=<dir with sources> -Dpattern=" \t"
>>
>> Regards,
>>
>> 2006/10/2, Alexey Petrenko <al...@gmail.com>:
>> > Does it work with the sequences like {"space", "space", "tab"} etc?
>> >
>> > 2006/10/2, Alexei Zakharov <al...@gmail.com>:
>> > > Hi all,
>> > >
>> > > I noticed that the tab character (0x09) is still widely used in our
>> > > classlib source code. At least in tests. From my recent experience
>> > > this leads to broken indentation. I mean the situation when patch
>> with
>> > > spaces is applied to the source there tab character is used for
>> > > indentation. Someone knows that according to Sun code conventions the
>> > > tab should be exactly 8 spaces. The other person knows that exactly
>> > > four spaces should be used as the unit of indentation [1]. As a
>> result
>> > > we have all methods indented with the single tab character and the
>> > > patched methods indented with 4 spaces. And if your IDE is configured
>> > > to display tabs as 8 spaces you will see broken indentation. Or vice
>> > > versa.
>> > >
>> > > I have created small ANT script - see HARMONY-1660 [2]. This script
>> > > converts all tabs to spaces in all found sources under the given
>> > > directory recursively. I will be grateful if someone runs this script
>> > > (tab -> 4 spaces) at least for beans tests (I currently working with)
>> > > and integrates the results. It is really painful to deal with this
>> > > broken alignment every day. And it is too boring (and IMHO silly) to
>> > > convert it file by file and send patches for each case.
>> > >
>> > > [1]
>> http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#262
>> > > [3] http://issues.apache.org/jira/browse/HARMONY-1660
>> > >
>> > > Thanks,
>>
>> --
>> Alexei Zakharov,
>> Intel Middleware Product Division
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>
>>
>
>
--
Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [classlib] removing \t from sources
Posted by Alexey Petrenko <al...@gmail.com>.
I mean that {"space", "space", "tab"} will be converted to the same
number of spaces as simple tab by the most of editors.
SY, Alexey
2006/10/2, Alexei Zakharov <al...@gmail.com>:
> What do you mean? Convert " \t" to something? If so please see the
> new fully customized version of my mega-script :-)
>
> The usage pattern in your case will be:
> ant -f tabs2spaces_v2.xml -Dsrc.dir=<dir with sources> -Dpattern=" \t"
>
> Regards,
>
> 2006/10/2, Alexey Petrenko <al...@gmail.com>:
> > Does it work with the sequences like {"space", "space", "tab"} etc?
> >
> > 2006/10/2, Alexei Zakharov <al...@gmail.com>:
> > > Hi all,
> > >
> > > I noticed that the tab character (0x09) is still widely used in our
> > > classlib source code. At least in tests. From my recent experience
> > > this leads to broken indentation. I mean the situation when patch with
> > > spaces is applied to the source there tab character is used for
> > > indentation. Someone knows that according to Sun code conventions the
> > > tab should be exactly 8 spaces. The other person knows that exactly
> > > four spaces should be used as the unit of indentation [1]. As a result
> > > we have all methods indented with the single tab character and the
> > > patched methods indented with 4 spaces. And if your IDE is configured
> > > to display tabs as 8 spaces you will see broken indentation. Or vice
> > > versa.
> > >
> > > I have created small ANT script - see HARMONY-1660 [2]. This script
> > > converts all tabs to spaces in all found sources under the given
> > > directory recursively. I will be grateful if someone runs this script
> > > (tab -> 4 spaces) at least for beans tests (I currently working with)
> > > and integrates the results. It is really painful to deal with this
> > > broken alignment every day. And it is too boring (and IMHO silly) to
> > > convert it file by file and send patches for each case.
> > >
> > > [1] http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#262
> > > [3] http://issues.apache.org/jira/browse/HARMONY-1660
> > >
> > > Thanks,
>
> --
> Alexei Zakharov,
> Intel Middleware Product Division
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>
--
Alexey A. Petrenko
Intel Middleware Products Division
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [classlib] removing \t from sources
Posted by Alexei Zakharov <al...@gmail.com>.
What do you mean? Convert " \t" to something? If so please see the
new fully customized version of my mega-script :-)
The usage pattern in your case will be:
ant -f tabs2spaces_v2.xml -Dsrc.dir=<dir with sources> -Dpattern=" \t"
Regards,
2006/10/2, Alexey Petrenko <al...@gmail.com>:
> Does it work with the sequences like {"space", "space", "tab"} etc?
>
> 2006/10/2, Alexei Zakharov <al...@gmail.com>:
> > Hi all,
> >
> > I noticed that the tab character (0x09) is still widely used in our
> > classlib source code. At least in tests. From my recent experience
> > this leads to broken indentation. I mean the situation when patch with
> > spaces is applied to the source there tab character is used for
> > indentation. Someone knows that according to Sun code conventions the
> > tab should be exactly 8 spaces. The other person knows that exactly
> > four spaces should be used as the unit of indentation [1]. As a result
> > we have all methods indented with the single tab character and the
> > patched methods indented with 4 spaces. And if your IDE is configured
> > to display tabs as 8 spaces you will see broken indentation. Or vice
> > versa.
> >
> > I have created small ANT script - see HARMONY-1660 [2]. This script
> > converts all tabs to spaces in all found sources under the given
> > directory recursively. I will be grateful if someone runs this script
> > (tab -> 4 spaces) at least for beans tests (I currently working with)
> > and integrates the results. It is really painful to deal with this
> > broken alignment every day. And it is too boring (and IMHO silly) to
> > convert it file by file and send patches for each case.
> >
> > [1] http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#262
> > [3] http://issues.apache.org/jira/browse/HARMONY-1660
> >
> > Thanks,
--
Alexei Zakharov,
Intel Middleware Product Division
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [classlib] removing \t from sources
Posted by Alexey Petrenko <al...@gmail.com>.
Does it work with the sequences like {"space", "space", "tab"} etc?
2006/10/2, Alexei Zakharov <al...@gmail.com>:
> Hi all,
>
> I noticed that the tab character (0x09) is still widely used in our
> classlib source code. At least in tests. From my recent experience
> this leads to broken indentation. I mean the situation when patch with
> spaces is applied to the source there tab character is used for
> indentation. Someone knows that according to Sun code conventions the
> tab should be exactly 8 spaces. The other person knows that exactly
> four spaces should be used as the unit of indentation [1]. As a result
> we have all methods indented with the single tab character and the
> patched methods indented with 4 spaces. And if your IDE is configured
> to display tabs as 8 spaces you will see broken indentation. Or vice
> versa.
>
> I have created small ANT script - see HARMONY-1660 [2]. This script
> converts all tabs to spaces in all found sources under the given
> directory recursively. I will be grateful if someone runs this script
> (tab -> 4 spaces) at least for beans tests (I currently working with)
> and integrates the results. It is really painful to deal with this
> broken alignment every day. And it is too boring (and IMHO silly) to
> convert it file by file and send patches for each case.
>
> [1] http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html#262
> [3] http://issues.apache.org/jira/browse/HARMONY-1660
>
> Thanks,
> --
> Alexei Zakharov,
> Intel Middleware Product Division
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>
--
Alexey A. Petrenko
Intel Middleware Products Division
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org