You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by David Crossley <cr...@apache.org> on 2005/08/24 06:15:20 UTC

Re: whitespace cleanup test [was: Re: svn commit: r239511 - /forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModule.java

Tim Williams wrote:
> Can someone with whitespace knowledge see if this actually cleaned up
> the whitespace issues in this file properly?

It was not a good test, because this file did not have a mixture
of tabs and space indenting, like many of our files do.

Also this file was in good shape - just some some trailing whitespace,
which your editor did properly clean up.

Other files (e.g. many of our stylesheets) have a mess of inconsistent
indenting. That is why we cannot just do a simple "replace all tabs
with spaces" - those files would still have bad indenting.

I think that we need to set up a test directory which has
examples of bad whitespace. I will go and start that.

>  I think my text editor
> has "wanted to do the right thing" all along but I've forced it into
> just doing functional diffs instead. I'm fairly confident that no one
> else is touching the files I am so if this works, I could go ahead and
> fix them all fairly quickly.
> --tim
> 
> > Author: twilliams
> > Date: Tue Aug 23 19:41:53 2005
> > New Revision: 239511
> > 
> > URL: http://svn.apache.org/viewcvs?rev=239511&view=rev
> > Log:
> > whitespace cleanup test
> > 
> > Modified:
> >     forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModule.java
> > 
> > Modified: forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModule.java
> > URL: http://svn.apache.org/viewcvs/forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModule.java?rev=239511&r1=239510&r2=239511&view=diff
> > ==============================================================================
> > --- forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModule.java (original)
> > +++ forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModule.java Tue Aug 23 19:41:53 2005
> > @@ -1,13 +1,13 @@
> >  /*
> >   * Copyright 1999-2004 The Apache Software Foundation or its licensors,
> >   * as applicable.
> > - *
> > + *

Argh, it seems that our program that inserted the license headers
in java files that were missing the license, adds trailing whitespace
after the comment marker on "blank" lines. So many of our java files
will have this problem.

-David

Re: whitespace cleanup test

Posted by David Crossley <cr...@apache.org>.
Diwaker Gupta wrote:
> > Jalopy was mentioned during that big cocoon-dev thread.
> > Follow the links from http://issues.apache.org/jira/browse/FOR-644
> > 
> > For some reason, we decided not to use it. Perhaps because
> > periodic cleanups can still cause havoc for people who
> > are working on those files. A lot of Cocoon people gave
> > it good reviews, but warned that any such cleanup
> > needs to be very careful.
> 
> I would still like to give it a shot. Hows this -- I run Jalopy on one
> of the "bad" files in the directory you have setup, and then the devs
> can have a look and decide if it works for them. If everyone like the
> output of Jalopy, I can run our source files through it once every
> week or so?
> 
> > Another issue is that it is only for java files,
> > whereas most of our problems are in the XSLT files.
> 
> True. Again, I would like to automate the process of cleaning. Tidy
> does a fairly good job with arbitrary XML (tidy.sf.net). We can also
> try using XML-Tidy
> (http://www.cpan.org/modules/by-module/XML/XML-Tidy-1.0.4C8K1Ah.readme).
> I'll give these a shot tonight and post feedback.

Yep, i like the idea of using tools to assist with
occasional cleanups.

I gather that we can define configuration files
to address certain things. That way any of the
committers can do such cleanups.

-David

Re: whitespace cleanup test

Posted by Diwaker Gupta <di...@apache.org>.
> Jalopy was mentioned during that big cocoon-dev thread.
> Follow the links from http://issues.apache.org/jira/browse/FOR-644
> 
> For some reason, we decided not to use it. Perhaps because
> periodic cleanups can still cause havoc for people who
> are working on those files. A lot of Cocoon people gave
> it good reviews, but warned that any such cleanup
> needs to be very careful.

I would still like to give it a shot. Hows this -- I run Jalopy on one
of the "bad" files in the directory you have setup, and then the devs
can have a look and decide if it works for them. If everyone like the
output of Jalopy, I can run our source files through it once every
week or so?

> Another issue is that it is only for java files,
> whereas most of our problems are in the XSLT files.

True. Again, I would like to automate the process of cleaning. Tidy
does a fairly good job with arbitrary XML (tidy.sf.net). We can also
try using XML-Tidy
(http://www.cpan.org/modules/by-module/XML/XML-Tidy-1.0.4C8K1Ah.readme).
I'll give these a shot tonight and post feedback.

Diwaker
-- 
Web/Blog/Gallery: floatingsun.net

Re: whitespace cleanup test

Posted by David Crossley <cr...@apache.org>.
Diwaker Gupta wrote:
> Can we use something like Jalopy (http://jalopy.sf.net) to periodically clean 
> up all the Java files? It doesn't need to be a Forrest. One of us can run it 
> through once in a while (I'm happy to volunteer). I've used Jalopy in the 
> past -- it works really well, its highly customizable, and has excellent Ant 
> integration.

Jalopy was mentioned during that big cocoon-dev thread.
Follow the links from http://issues.apache.org/jira/browse/FOR-644

For some reason, we decided not to use it. Perhaps because
periodic cleanups can still cause havoc for people who
are working on those files. A lot of Cocoon people gave
it good reviews, but warned that any such cleanup
needs to be very careful.

Another issue is that it is only for java files,
whereas most of our problems are in the XSLT files.

-David

Re: whitespace cleanup test

Posted by Diwaker Gupta <di...@apache.org>.
Can we use something like Jalopy (http://jalopy.sf.net) to periodically clean 
up all the Java files? It doesn't need to be a Forrest. One of us can run it 
through once in a while (I'm happy to volunteer). I've used Jalopy in the 
past -- it works really well, its highly customizable, and has excellent Ant 
integration.

On Tuesday 23 August 2005 9:15 pm, David Crossley wrote:
> Tim Williams wrote:
> > Can someone with whitespace knowledge see if this actually cleaned up
> > the whitespace issues in this file properly?
>
> It was not a good test, because this file did not have a mixture
> of tabs and space indenting, like many of our files do.
>
> Also this file was in good shape - just some some trailing whitespace,
> which your editor did properly clean up.
>
> Other files (e.g. many of our stylesheets) have a mess of inconsistent
> indenting. That is why we cannot just do a simple "replace all tabs
> with spaces" - those files would still have bad indenting.
>
> I think that we need to set up a test directory which has
> examples of bad whitespace. I will go and start that.
>
> >  I think my text editor
> > has "wanted to do the right thing" all along but I've forced it into
> > just doing functional diffs instead. I'm fairly confident that no one
> > else is touching the files I am so if this works, I could go ahead and
> > fix them all fairly quickly.
> > --tim
> >
> > > Author: twilliams
> > > Date: Tue Aug 23 19:41:53 2005
> > > New Revision: 239511
> > >
> > > URL: http://svn.apache.org/viewcvs?rev=239511&view=rev
> > > Log:
> > > whitespace cleanup test
> > >
> > > Modified:
> > >    
> > > forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModul
> > >e.java
> > >
> > > Modified:
> > > forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModul
> > >e.java URL:
> > > http://svn.apache.org/viewcvs/forrest/trunk/main/java/org/apache/forres
> > >t/locationmap/LocationMapModule.java?rev=239511&r1=239510&r2=239511&view
> > >=diff
> > > =======================================================================
> > >======= ---
> > > forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModul
> > >e.java (original) +++
> > > forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModul
> > >e.java Tue Aug 23 19:41:53 2005 @@ -1,13 +1,13 @@
> > >  /*
> > >   * Copyright 1999-2004 The Apache Software Foundation or its
> > > licensors, * as applicable.
> > > - *
> > > + *
>
> Argh, it seems that our program that inserted the license headers
> in java files that were missing the license, adds trailing whitespace
> after the comment marker on "blank" lines. So many of our java files
> will have this problem.
>
> -David

-- 
Web/Blog/Gallery: http://floatingsun.net