You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Frank Bille <fr...@gmail.com> on 2006/11/05 11:12:10 UTC

License headers

Last night when I couldn't sleep I got this crazy idea to write a unittest
for checking the source files in the project for correct license headers.
When I woke up this morning the idea still seemed quite reasonable, so I
cleaned it up and have now committed some code for it[1].

So what does this mean? Well to begin with the test checks the following
file types: .java, .xml, .html, .properties, .fml, .css and .vm. For .java
files it's checking on the new updated Apache2 license header[2], *without*
our svn keywords. The developers I have talked to doesn't seem to care about
those anyway, but WDYT?

The test doesn't fix the headers or add the license.

WDYT?

Frank

[1]: http://svn.apache.org/viewvc?view=rev&rev=471390
[2]: http://www.apache.org/legal/src-headers.html

Re: License headers

Posted by Erik van Oosten <e....@chello.nl>.
My point is that in checkstyle you are free to enforce both the presence 
_and absence_ of anything that can be expressed as a regular expression. 
So that includes the $Id$ tag.

That I always enforce inclusion of an $Id$ is just an example. In most 
of my projects I don't have a lot of merging to do. I can imagine that 
you would enforce exclusion of $Id$ for Wicket.

Regards,
    Erik.


Johan Compagner schreef:
> i don't hope that #Id# is mandatory!
> I hate those things. Because those things mess up merging of branches
> because they constantly change.
> It is totally stupid that this is the case. A merge should ignore those
> completely.
>
> johan

-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


Re: License headers

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 11/6/06, Johan Compagner <jc...@gmail.com> wrote:
> ...i don't hope that #Id# is mandatory!..

It is not required by the ASF license header requirements, if that's
what you mean.

-Bertrand

Re: License headers

Posted by Johan Compagner <jc...@gmail.com>.
i don't hope that #Id# is mandatory!
I hate those things. Because those things mess up merging of branches
because they constantly change.
It is totally stupid that this is the case. A merge should ignore those
completely.

johan


On 11/6/06, Erik van Oosten <e....@chello.nl> wrote:
>
> Hi Martijn,
>
> There are checkstyle plugins for Eclipse and for IDEA. Don't know about
> Netbeans.
> In addition checkstyle is able to check for a header (even as a RE), or
> check for the presence/absence of any RE.
>
> I used checkstyle frequently to enforce a correct copyright header, the
> presence of an $Id$ tag, presence of javadoc and a lot of code
> formatting rules.
>
> Regards,
>      Erik.
>
>
> Martijn Dashorst schreef:
> > I was going to propose to use checkstyle instead. Problem with
> > checkstyle is that it is not a unit test and doesn't run inside
> > Eclipse, NetBeans or IDEA :-).
> >
>
> --
> Erik van Oosten
> http://www.day-to-day-stuff.blogspot.com/
>
>

Re: License headers

Posted by Erik van Oosten <e....@chello.nl>.
Hi Martijn,

There are checkstyle plugins for Eclipse and for IDEA. Don't know about 
Netbeans.
In addition checkstyle is able to check for a header (even as a RE), or 
check for the presence/absence of any RE.

I used checkstyle frequently to enforce a correct copyright header, the 
presence of an $Id$ tag, presence of javadoc and a lot of code 
formatting rules.

Regards,
     Erik.


Martijn Dashorst schreef:
> I was going to propose to use checkstyle instead. Problem with
> checkstyle is that it is not a unit test and doesn't run inside
> Eclipse, NetBeans or IDEA :-).
>

-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


Re: Re: Re: Re: License headers

Posted by Martijn Dashorst <ma...@gmail.com>.
On 11/5/06, Frank Bille <fr...@gmail.com> wrote:
> Good idea let me play around with that. :)

Don't let me hold you back, it is all yours! (I only want to play with
your toys at a later time)

Martijn

Re: Re: Re: License headers

Posted by Frank Bille <fr...@gmail.com>.
On 11/5/06, Martijn Dashorst <ma...@gmail.com> wrote:
>
> Anyhow, the check could also be a unit test, and the actual
> checking/file scanner could be implemented in Wicket core (though it
> is not a specific framework concern imo).
>

Good idea let me play around with that. :)

Frank

Re: Re: Re: License headers

Posted by Martijn Dashorst <ma...@gmail.com>.
Their site is now out of order, so I couldn't check it. I thought you
could supply a file pattern.

Anyhow, the check could also be a unit test, and the actual
checking/file scanner could be implemented in Wicket core (though it
is not a specific framework concern imo).

All sub projects could then implement the license check in their own
unit tests. Even the base test case could be inside the
'wicket.util.license' package:

protected abstract class ApacheLicenseTest extends TestCase {
    public void testJavaScript() {
         // do test
    }
    public void testCss() {
         // do test
    }
    public void testJava() {
         // do test
    }
    public void testHtml() {
         // do test
    }
    // etc.
}

Each project then only has to do (will automatically be picked up by
the testrunner):

public WicketApacheLicenseTest extends ApacheLicenseTest {
}

public WicketExtensionsApacheLicenseTest extends ApacheLicenseTest {
}

Martijn

On 11/5/06, Frank Bille <fr...@gmail.com> wrote:
> I don't know checkstyle very well, but doesn't it only handle java code?
>
> Frank
>
>
> On 11/5/06, Martijn Dashorst <ma...@gmail.com> wrote:
> >
> > On 11/5/06, Frank Bille <fr...@gmail.com> wrote:
> > > The bad thing about having it as a unittest is that it has to be copied
> > to
> > > every subproject and can't just be run off wicket-parent.
> >
> > True, that is an argument for using checkstyle.
> >
> > Martijn
> >
> > --
> > <a href="http://www.thebeststuffintheworld.com/vote_for/wicket">Vote</a>
> > for <a href="http://www.thebeststuffintheworld.com/stuff/wicket
> > ">Wicket</a>
> > at the <a href="http://www.thebeststuffintheworld.com/">Best Stuff in
> > the World!</a>
> >
>
>


-- 
<a href="http://www.thebeststuffintheworld.com/vote_for/wicket">Vote</a>
for <a href="http://www.thebeststuffintheworld.com/stuff/wicket">Wicket</a>
at the <a href="http://www.thebeststuffintheworld.com/">Best Stuff in
the World!</a>

Re: Re: License headers

Posted by Frank Bille <fr...@gmail.com>.
I don't know checkstyle very well, but doesn't it only handle java code?

Frank


On 11/5/06, Martijn Dashorst <ma...@gmail.com> wrote:
>
> On 11/5/06, Frank Bille <fr...@gmail.com> wrote:
> > The bad thing about having it as a unittest is that it has to be copied
> to
> > every subproject and can't just be run off wicket-parent.
>
> True, that is an argument for using checkstyle.
>
> Martijn
>
> --
> <a href="http://www.thebeststuffintheworld.com/vote_for/wicket">Vote</a>
> for <a href="http://www.thebeststuffintheworld.com/stuff/wicket
> ">Wicket</a>
> at the <a href="http://www.thebeststuffintheworld.com/">Best Stuff in
> the World!</a>
>

Re: Re: License headers

Posted by Martijn Dashorst <ma...@gmail.com>.
On 11/5/06, Frank Bille <fr...@gmail.com> wrote:
> The bad thing about having it as a unittest is that it has to be copied to
> every subproject and can't just be run off wicket-parent.

True, that is an argument for using checkstyle.

Martijn

-- 
<a href="http://www.thebeststuffintheworld.com/vote_for/wicket">Vote</a>
for <a href="http://www.thebeststuffintheworld.com/stuff/wicket">Wicket</a>
at the <a href="http://www.thebeststuffintheworld.com/">Best Stuff in
the World!</a>

Re: License headers

Posted by Frank Bille <fr...@gmail.com>.
But yeah I forgot the .js files. I'll add them right away.

The bad thing about having it as a unittest is that it has to be copied to
every subproject and can't just be run off wicket-parent.

What to do with all these license headers when "building binaries"/"sending
output to client"/etc. is another discussion. :)

Frank

On 11/5/06, Martijn Dashorst <ma...@gmail.com> wrote:
>
> I was going to propose to use checkstyle instead. Problem with
> checkstyle is that it is not a unit test and doesn't run inside
> Eclipse, NetBeans or IDEA :-).
>
> I would also (as a preliminary action) add javascript to the list
> (.js). We can always remove them, but at the moment, they need to be
> in there. I don't expect ASF to relax their stance on those files.
>
> +1 on removing the svn keywords.
>
> Martijn
>
> On 11/5/06, Frank Bille <fr...@gmail.com> wrote:
> > Last night when I couldn't sleep I got this crazy idea to write a
> unittest
> > for checking the source files in the project for correct license
> headers.
> > When I woke up this morning the idea still seemed quite reasonable, so I
> > cleaned it up and have now committed some code for it[1].
> >
> > So what does this mean? Well to begin with the test checks the following
> > file types: .java, .xml, .html, .properties, .fml, .css and .vm. For
> .java
> > files it's checking on the new updated Apache2 license header[2],
> *without*
> > our svn keywords. The developers I have talked to doesn't seem to care
> about
> > those anyway, but WDYT?
> >
> > The test doesn't fix the headers or add the license.
> >
> > WDYT?
> >
> > Frank
> >
> > [1]: http://svn.apache.org/viewvc?view=rev&rev=471390
> > [2]: http://www.apache.org/legal/src-headers.html
> >
> >
>
>
> --
> <a href="http://www.thebeststuffintheworld.com/vote_for/wicket">Vote</a>
> for <a href="http://www.thebeststuffintheworld.com/stuff/wicket
> ">Wicket</a>
> at the <a href="http://www.thebeststuffintheworld.com/">Best Stuff in
> the World!</a>
>

Re: License headers

Posted by Martijn Dashorst <ma...@gmail.com>.
I was going to propose to use checkstyle instead. Problem with
checkstyle is that it is not a unit test and doesn't run inside
Eclipse, NetBeans or IDEA :-).

I would also (as a preliminary action) add javascript to the list
(.js). We can always remove them, but at the moment, they need to be
in there. I don't expect ASF to relax their stance on those files.

+1 on removing the svn keywords.

Martijn

On 11/5/06, Frank Bille <fr...@gmail.com> wrote:
> Last night when I couldn't sleep I got this crazy idea to write a unittest
> for checking the source files in the project for correct license headers.
> When I woke up this morning the idea still seemed quite reasonable, so I
> cleaned it up and have now committed some code for it[1].
>
> So what does this mean? Well to begin with the test checks the following
> file types: .java, .xml, .html, .properties, .fml, .css and .vm. For .java
> files it's checking on the new updated Apache2 license header[2], *without*
> our svn keywords. The developers I have talked to doesn't seem to care about
> those anyway, but WDYT?
>
> The test doesn't fix the headers or add the license.
>
> WDYT?
>
> Frank
>
> [1]: http://svn.apache.org/viewvc?view=rev&rev=471390
> [2]: http://www.apache.org/legal/src-headers.html
>
>


-- 
<a href="http://www.thebeststuffintheworld.com/vote_for/wicket">Vote</a>
for <a href="http://www.thebeststuffintheworld.com/stuff/wicket">Wicket</a>
at the <a href="http://www.thebeststuffintheworld.com/">Best Stuff in
the World!</a>

Re: License headers

Posted by Frank Bille <fr...@gmail.com>.
BTW, all our .java files needs to have it's license updated anyway, because
of [2].


On 11/5/06, Frank Bille <fr...@gmail.com> wrote:
>
> Last night when I couldn't sleep I got this crazy idea to write a unittest
> for checking the source files in the project for correct license headers.
> When I woke up this morning the idea still seemed quite reasonable, so I
> cleaned it up and have now committed some code for it[1].
>
> So what does this mean? Well to begin with the test checks the following
> file types: .java, .xml, .html, .properties, .fml, .css and .vm. For .java
> files it's checking on the new updated Apache2 license header[2], *without*
> our svn keywords. The developers I have talked to doesn't seem to care about
> those anyway, but WDYT?
>
> The test doesn't fix the headers or add the license.
>
> WDYT?
>
> Frank
>
> [1]: http://svn.apache.org/viewvc?view=rev&rev=471390
> [2]: http://www.apache.org/legal/src-headers.html
>