You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2007/02/06 10:04:06 UTC

[jira] Created: (SOLR-143) Support for PMD and Clover

Support for PMD and Clover
--------------------------

                 Key: SOLR-143
                 URL: https://issues.apache.org/jira/browse/SOLR-143
             Project: Solr
          Issue Type: Improvement
            Reporter: Hoss Man
            Priority: Minor


had some time on a plane this weekend, so I adapted some of the clover hooks from Java-Lucene to Solr's build.xml and also put in hooks for running PMD (a bug pattern finding tool).

the PMD hook actually teste the PMD ruleset twice, once warning about any violations, and once failing the build if any serious violations were found ... the goal would be to hook this into the "ant test" target so you can't successfully build if you have any serious rule violations.

i strarted with a custom ruleset based on some of the bigger rules from PMD ... the theory being that as well clean up the code base we can add more nit-picky rules if we want to :)

User is required to provide their own copy of PMD and/or clover on in an ANT_LIB. Clover requires (ASF committer) license, PMD is freely available...

http://pmd.sourceforge.net/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-143) Support for PMD and Clover

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470614 ] 

Yonik Seeley commented on SOLR-143:
-----------------------------------

While checking is nice, I'm not sure about requiring PMD before you can build Solr.
Is PMD better than the code inspections in IntelliJ/Eclipse?

> Support for PMD and Clover
> --------------------------
>
>                 Key: SOLR-143
>                 URL: https://issues.apache.org/jira/browse/SOLR-143
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>            Priority: Minor
>         Attachments: pmd-and-clover.diff
>
>
> had some time on a plane this weekend, so I adapted some of the clover hooks from Java-Lucene to Solr's build.xml and also put in hooks for running PMD (a bug pattern finding tool).
> the PMD hook actually teste the PMD ruleset twice, once warning about any violations, and once failing the build if any serious violations were found ... the goal would be to hook this into the "ant test" target so you can't successfully build if you have any serious rule violations.
> i strarted with a custom ruleset based on some of the bigger rules from PMD ... the theory being that as well clean up the code base we can add more nit-picky rules if we want to :)
> User is required to provide their own copy of PMD and/or clover on in an ANT_LIB. Clover requires (ASF committer) license, PMD is freely available...
> http://pmd.sourceforge.net/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-143) Support for PMD and Clover

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-143?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan McKinley updated SOLR-143:
-------------------------------

    Attachment: SOLR-143-CloverAndPMD.patch

Updated to apply with trunk -- unlike the original patch, this does not try to fix the serious errors (we can do that later)

For anyone trying to run - this does not require that you have PMD or clover, it just generates reports if you ask for them (and have it configured)

For anyone trying to run, these are the command lines:
 ant clean
 ant test -Drun.clover=true
 ant clover-reports -Drun.clover=true
 ant pmd-reports 

Is there a reason to have the -Drun.clover configuration rather then the target specifying if clover is used or not?

> Support for PMD and Clover
> --------------------------
>
>                 Key: SOLR-143
>                 URL: https://issues.apache.org/jira/browse/SOLR-143
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>            Priority: Minor
>         Attachments: pmd-and-clover.diff, SOLR-143-CloverAndPMD.patch
>
>
> had some time on a plane this weekend, so I adapted some of the clover hooks from Java-Lucene to Solr's build.xml and also put in hooks for running PMD (a bug pattern finding tool).
> the PMD hook actually teste the PMD ruleset twice, once warning about any violations, and once failing the build if any serious violations were found ... the goal would be to hook this into the "ant test" target so you can't successfully build if you have any serious rule violations.
> i strarted with a custom ruleset based on some of the bigger rules from PMD ... the theory being that as well clean up the code base we can add more nit-picky rules if we want to :)
> User is required to provide their own copy of PMD and/or clover on in an ANT_LIB. Clover requires (ASF committer) license, PMD is freely available...
> http://pmd.sourceforge.net/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-143) Support for PMD and Clover

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-143?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-143:
--------------------------

    Attachment: pmd-and-clover.diff

this patch includes some XSLT/javascript from the PMD 3.9 release so i'm not granting lcense for inclusion until i double check that is viable.

> Support for PMD and Clover
> --------------------------
>
>                 Key: SOLR-143
>                 URL: https://issues.apache.org/jira/browse/SOLR-143
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>            Priority: Minor
>         Attachments: pmd-and-clover.diff
>
>
> had some time on a plane this weekend, so I adapted some of the clover hooks from Java-Lucene to Solr's build.xml and also put in hooks for running PMD (a bug pattern finding tool).
> the PMD hook actually teste the PMD ruleset twice, once warning about any violations, and once failing the build if any serious violations were found ... the goal would be to hook this into the "ant test" target so you can't successfully build if you have any serious rule violations.
> i strarted with a custom ruleset based on some of the bigger rules from PMD ... the theory being that as well clean up the code base we can add more nit-picky rules if we want to :)
> User is required to provide their own copy of PMD and/or clover on in an ANT_LIB. Clover requires (ASF committer) license, PMD is freely available...
> http://pmd.sourceforge.net/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-143) Support for PMD and Clover

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505372 ] 

Ryan McKinley commented on SOLR-143:
------------------------------------

what do you think about including this soon?  With all the recent changes, it would be nice easily integrate with clover...

> Support for PMD and Clover
> --------------------------
>
>                 Key: SOLR-143
>                 URL: https://issues.apache.org/jira/browse/SOLR-143
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>            Priority: Minor
>         Attachments: pmd-and-clover.diff, SOLR-143-CloverAndPMD.patch
>
>
> had some time on a plane this weekend, so I adapted some of the clover hooks from Java-Lucene to Solr's build.xml and also put in hooks for running PMD (a bug pattern finding tool).
> the PMD hook actually teste the PMD ruleset twice, once warning about any violations, and once failing the build if any serious violations were found ... the goal would be to hook this into the "ant test" target so you can't successfully build if you have any serious rule violations.
> i strarted with a custom ruleset based on some of the bigger rules from PMD ... the theory being that as well clean up the code base we can add more nit-picky rules if we want to :)
> User is required to provide their own copy of PMD and/or clover on in an ANT_LIB. Clover requires (ASF committer) license, PMD is freely available...
> http://pmd.sourceforge.net/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-143) Support for PMD and Clover

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501708 ] 

Hoss Man commented on SOLR-143:
-------------------------------

Ryan, i haven't looked at your updated patch, but i don't understand your last comment...

> Is there a reason to have the -Drun.clover configuration rather then the target specifying if clover is used or not?

how would that work exactly?  the run.clover property is what's used to ensure that code is compiled with clover hooks (in the existing "compile" target) and that the clover db is initialized prior to running the unit tests (in the existing "test" target).

> Support for PMD and Clover
> --------------------------
>
>                 Key: SOLR-143
>                 URL: https://issues.apache.org/jira/browse/SOLR-143
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>            Priority: Minor
>         Attachments: pmd-and-clover.diff, SOLR-143-CloverAndPMD.patch
>
>
> had some time on a plane this weekend, so I adapted some of the clover hooks from Java-Lucene to Solr's build.xml and also put in hooks for running PMD (a bug pattern finding tool).
> the PMD hook actually teste the PMD ruleset twice, once warning about any violations, and once failing the build if any serious violations were found ... the goal would be to hook this into the "ant test" target so you can't successfully build if you have any serious rule violations.
> i strarted with a custom ruleset based on some of the bigger rules from PMD ... the theory being that as well clean up the code base we can add more nit-picky rules if we want to :)
> User is required to provide their own copy of PMD and/or clover on in an ANT_LIB. Clover requires (ASF committer) license, PMD is freely available...
> http://pmd.sourceforge.net/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: clover and hudson (and jetty) -- was Re: [jira] Commented: (SOLR-143) Support for PMD and Clover

Posted by Nigel Daley <nd...@yahoo-inc.com>.
On Jun 16, 2007, at 11:01 AM, Chris Hostetter wrote:

>
> : Is there any downside to switching to hudson?
>
> someone has to learn how to configure it (my main impression: it's got
> a lot more bells and whistles then a shell script cron job, but a  
> shell
> script cronjob is pretty easy to read and understand)

Hudson can easily run maven targets, ant targets, or a shell script.   
If you want to do anything fancy, then I suspect you'll need Hudson  
to run a shell script (like the Lucene build does).  Let me know if I  
can help.  I don't monitor this list very often so please CC nigel at  
apache.org.

Cheers,
Nige

Re: clover and hudson (and jetty) -- was Re: [jira] Commented: (SOLR-143) Support for PMD and Clover

Posted by Chris Hostetter <ho...@fucit.org>.
: Is there any downside to switching to hudson?

someone has to learn how to configure it (my main impression: it's got
a lot more bells and whistles then a shell script cron job, but a shell
script cronjob is pretty easy to read and understand)

: Is it possible to have the "ant test-reports" output avaliable?  I like
: it better then the husdon test output:
: http://lucene.zones.apache.org:8080/hudson/job/Solr-Nightly/113/testReport/

i'm pretty sure you can configure Hudson to link to any "artifact" you
want (where an artifact can be a file or a directory) ... this is how the
clover reports work in lucene-java, i'm sure we can do the same thing for
the test-reports (we just need to be creative with our configs so it
alwasy runs even if the "test" target fails.)


-Hoss


Re: clover and hudson (and jetty) -- was Re: [jira] Commented: (SOLR-143) Support for PMD and Clover

Posted by Ryan McKinley <ry...@gmail.com>.
Chris Hostetter wrote:
> : It might be best to just pursue the clover integration separately from
> 
> since the biggest benefit of clover is likely to be modifying the nightly
> build to run it, and since we (may) have a problem with the nightly.sh
> script and the new unit tests ryan wrote that run jetty, perhaps now is a
> good time to consider switching to using hudson as our primary build
> integration system?
> 

Is there any downside to switching to hudson?

It seems like a great option - nightly javadocs / test-reports / clover...

Is it possible to have the "ant test-reports" output avaliable?  I like 
it better then the husdon test output:
http://lucene.zones.apache.org:8080/hudson/job/Solr-Nightly/113/testReport/

ryan

clover and hudson (and jetty) -- was Re: [jira] Commented: (SOLR-143) Support for PMD and Clover

Posted by Chris Hostetter <ho...@fucit.org>.
: It might be best to just pursue the clover integration separately from

since the biggest benefit of clover is likely to be modifying the nightly
build to run it, and since we (may) have a problem with the nightly.sh
script and the new unit tests ryan wrote that run jetty, perhaps now is a
good time to consider switching to using hudson as our primary build
integration system?

(ie: turn off the nightly.sh cron, link to hudson for nightly builds, take
over ownership of the Hudson SOlr configuration from the guy whose name I
can't remember who orriginally set it all up for Hadoop, learn how to take
advantage of some of hte cool Jira/patch hooks it aparently has, etc...)

thoughts?



-Hoss


[jira] Commented: (SOLR-143) Support for PMD and Clover

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505426 ] 

Hoss Man commented on SOLR-143:
-------------------------------

1) i never got a chance to look into the license issues of including the XSLT for
formating the PMD output in solr

2) since opening this issue, i have found better ways to do things with PMD instead of needing to run the analysis twice.


It might be best to just pursue the clover integration separately from the PMD stuff since many people use IDEs that have "code inspectors" for doing PMD type stuff built into them. ... then we can revist PMD later if we want.



> Support for PMD and Clover
> --------------------------
>
>                 Key: SOLR-143
>                 URL: https://issues.apache.org/jira/browse/SOLR-143
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>            Priority: Minor
>         Attachments: pmd-and-clover.diff, SOLR-143-CloverAndPMD.patch
>
>
> had some time on a plane this weekend, so I adapted some of the clover hooks from Java-Lucene to Solr's build.xml and also put in hooks for running PMD (a bug pattern finding tool).
> the PMD hook actually teste the PMD ruleset twice, once warning about any violations, and once failing the build if any serious violations were found ... the goal would be to hook this into the "ant test" target so you can't successfully build if you have any serious rule violations.
> i strarted with a custom ruleset based on some of the bigger rules from PMD ... the theory being that as well clean up the code base we can add more nit-picky rules if we want to :)
> User is required to provide their own copy of PMD and/or clover on in an ANT_LIB. Clover requires (ASF committer) license, PMD is freely available...
> http://pmd.sourceforge.net/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-143) Support for PMD and Clover

Posted by "Paul Sundling (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519525 ] 

Paul Sundling commented on SOLR-143:
------------------------------------

It would be trivial to integrate PMD and clover if you add a maven build.  There are already plugins and I've used them successfully myself.  They run during "site" generation which generates reports, although they can also be used to fail a build if desired.

The eclipse plugin for PMD is great, because it includes links to the detailed description on why the issues are a bad practice.  There were a few links missing, but I added a patch to add the missing links.  However there is a bug in the eclipse plugin where the links stop working if you export the ruleset. (http://sourceforge.net/tracker/index.php?func=detail&aid=1745607&group_id=132036&atid=723729) 

> Support for PMD and Clover
> --------------------------
>
>                 Key: SOLR-143
>                 URL: https://issues.apache.org/jira/browse/SOLR-143
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>            Priority: Minor
>         Attachments: pmd-and-clover.diff, SOLR-143-CloverAndPMD.patch
>
>
> had some time on a plane this weekend, so I adapted some of the clover hooks from Java-Lucene to Solr's build.xml and also put in hooks for running PMD (a bug pattern finding tool).
> the PMD hook actually teste the PMD ruleset twice, once warning about any violations, and once failing the build if any serious violations were found ... the goal would be to hook this into the "ant test" target so you can't successfully build if you have any serious rule violations.
> i strarted with a custom ruleset based on some of the bigger rules from PMD ... the theory being that as well clean up the code base we can add more nit-picky rules if we want to :)
> User is required to provide their own copy of PMD and/or clover on in an ANT_LIB. Clover requires (ASF committer) license, PMD is freely available...
> http://pmd.sourceforge.net/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-143) Support for PMD and Clover

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470721 ] 

Hoss Man commented on SOLR-143:
-------------------------------

my thinking is that initially PMD would be a completely optional step, which committers are encouraged to run before committing, and which the nightly build runs with the "serious" threshold low enough that only extreme rules cause a build failure. ... the main goal would be having a report on the live site showing where in the nightly builds questionable behavior is (mush as the goal of clover is to have the reports about hte nightlies to see where we need more test coverage)

i agree -- it PMD shouldn't be mandatory just to build Solr.

I can't make any specific comments about PMD being better then the tools that various IDEs have ... as i understand it many IDEs use either PMD or FindBugs ... my goal was just to have something that could be run as part of theautomated builds.

(by all means: people using IDEs with code inspectors should run them and fix anything that looks suspicious)

> Support for PMD and Clover
> --------------------------
>
>                 Key: SOLR-143
>                 URL: https://issues.apache.org/jira/browse/SOLR-143
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>            Priority: Minor
>         Attachments: pmd-and-clover.diff
>
>
> had some time on a plane this weekend, so I adapted some of the clover hooks from Java-Lucene to Solr's build.xml and also put in hooks for running PMD (a bug pattern finding tool).
> the PMD hook actually teste the PMD ruleset twice, once warning about any violations, and once failing the build if any serious violations were found ... the goal would be to hook this into the "ant test" target so you can't successfully build if you have any serious rule violations.
> i strarted with a custom ruleset based on some of the bigger rules from PMD ... the theory being that as well clean up the code base we can add more nit-picky rules if we want to :)
> User is required to provide their own copy of PMD and/or clover on in an ANT_LIB. Clover requires (ASF committer) license, PMD is freely available...
> http://pmd.sourceforge.net/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-143) Support for PMD and Clover

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501725 ] 

Ryan McKinley commented on SOLR-143:
------------------------------------

> 
> Ryan, i haven't looked at your updated patch, but i don't understand your last comment...
> 

There is nothing interisting in the changes, it just does not conflict with the recently added init-forrest-entities

The patch also removes your attempts to fix the PMD serious errors (4 months later, most of the .java files have conflict)  We should probalby fix them when this does get added.


>> Is there a reason to have the -Drun.clover configuration rather then the target specifying if clover is used or not?
> 
> how would that work exactly?  the run.clover property is what's used to ensure that code is compiled with clover hooks (in the existing "compile" target) and that the clover db is initialized prior to running the unit tests (in the existing "test" target).
> 

magic!

I just looked into other projects I thought did this - they have different 'compile' tasks for test and dist and require everyone to have clover.  This is not appropriate for solr, so the -Drun.clover option is better.


> Support for PMD and Clover
> --------------------------
>
>                 Key: SOLR-143
>                 URL: https://issues.apache.org/jira/browse/SOLR-143
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>            Priority: Minor
>         Attachments: pmd-and-clover.diff, SOLR-143-CloverAndPMD.patch
>
>
> had some time on a plane this weekend, so I adapted some of the clover hooks from Java-Lucene to Solr's build.xml and also put in hooks for running PMD (a bug pattern finding tool).
> the PMD hook actually teste the PMD ruleset twice, once warning about any violations, and once failing the build if any serious violations were found ... the goal would be to hook this into the "ant test" target so you can't successfully build if you have any serious rule violations.
> i strarted with a custom ruleset based on some of the bigger rules from PMD ... the theory being that as well clean up the code base we can add more nit-picky rules if we want to :)
> User is required to provide their own copy of PMD and/or clover on in an ANT_LIB. Clover requires (ASF committer) license, PMD is freely available...
> http://pmd.sourceforge.net/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.