Hello,

seems to me like you are feeding Checkstyle 5 with rules set
compatible with Checkstyle 4.4 (or something similar - Checkstyle is
not always backward-compatible).

-- 
Regards / Pozdrawiam
Tomek Kaczanowski



2010/5/6 mjparme <[email protected]>:
>
> I am trying to use the Ant task to run Checkstyle (the built-in checkstyle
> task appears to require the config file to be on the local filesystem, mine
> is on a webserver so it can be used by everyone).
>
> Here is my task:
>
> task checkstyle {
>    ant.taskdef(resource: 'checkstyletask.properties', classpath:
> configurations.checkstyle.asPath) {
>        classpath {
>            fileset(dir: 'lib') {
>                include(name: '*.jar')
>            }
>        }
>    }
>
>    ant.checkstyle(configurl: 'http://linux15/java/custom_checks.xml') {
>        fileset(dir: 'src')  <--This appears to be the offending line
>        formatter(type: 'plain')
>        formatter(type: 'xml', toFile: 'build/checkstyle_errors.xml')
>    }
> }
>
> The "fileset(dir: 'src')" line seems to be the one creating this Exception,
> I have no idea what it means by "TreeWalker is not allowed as a parent of
> FileLength". Where is it getting FileLength from?
>
> Can anyone provide any insight?
>
> Caused by: org.apache.tools.ant.BuildException: Unable to create a Checker:
> cannot initialize module TreeWalker - TreeWalker is not allowed as a parent
> of FileLength
>        at
> com.puppycrawl.tools.checkstyle.CheckStyleTask.createChecker(CheckStyleTask.java:383)
>        at
> com.puppycrawl.tools.checkstyle.CheckStyleTask.realExecute(CheckStyleTask.java:300)
>        at
> com.puppycrawl.tools.checkstyle.CheckStyleTask.execute(CheckStyleTask.java:262)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
>        at org.apache.tools.ant.Task.perform(Task.java:348)
>        at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:204)
>        at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
>        at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:154)
>        at
> org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod(BasicA
> --
> View this message in context: 
> http://old.nabble.com/Trying-to-use-Checkstyle%2C-getting-TreeWalker-error-tp28476461p28476461.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



-- 
Regards / Pozdrawiam
Tomek Kaczanowski

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to