creadur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: PatternSyntaxException when trying rat -E
Date Sun, 07 Apr 2013 23:26:59 GMT
Created RAT-134


On 7 April 2013 22:48, sebb <sebbaz@gmail.com> wrote:

> On 7 April 2013 20:09, Jochen Wiedmann <jochen.wiedmann@gmail.com> wrote:
>
>> > It looks like Apache RAT 0.8 uses standard Java wildcard regex file
>> > matching, whereas the original RAT used a different set of wildcard
>> > meta-characters - more like the syntax used by Maven and Ant.
>>
>> Unfortunately, in this particular case, there is no such thing like "Rat",
>> but there are
>>
>> a) the Rat Maven Plugin (uses Plexus Utils internally, hence Maven style)
>> b) the Rat Ant Tasks (uses Ant pattern matcher internally, hence Ant
>> style)
>> c) the Rat CLI, which probably uses native Java patterns (dunno)
>>
>>
> It uses Commons IO.
>
> For the -E option (expressions read from a file), it uses RegexFileFilter
> which uses java.util.regex.Pattern syntax.
>
> For the -e option (expression provided on command-line), it uses
> WildcardFileFilter, whose Javadoc says:
> "The wildcard matcher uses the characters '?' and '*' to represent a
> single or multiple wildcard characters. This is the same as often found on
> Dos/Unix command lines."
>
> I cannot see any valid reason for that discrepancy.
>
> Ant is the same as WildcardFileFilter, except that:
> + When ** is used as the name of a directory in the pattern, it matches
> zero or more directories.
> + There is one "shorthand": if a pattern ends with / or \, then ** is
> appended.
>
> I think the Maven syntax is much the same as Ant (but there could be
> differences in edge cases)
>
> I agree that RAT CLI should use Ant/Maven style.
>
>
>> My suggestion would be to switch to either Ant, or Maven anyways. (At
>> least, I assume that Allura has got a build script.)
>>
>>
>> Jochen
>>
>>
>>
>> On Fri, Apr 5, 2013 at 5:09 AM, sebb <sebbaz@gmail.com> wrote:
>>
>> > On 4 April 2013 20:42, Peter Hartmann <mailbox.tec@gmail.com> wrote:
>> >
>> > > Hello
>> > >
>> > > I'm contributing to Apache Allura incubating project, where my efforts
>> > are
>> > > mostly focused on getting a release out. I've attempted a RAT testing,
>> > but
>> > > it gives me an error when I try to use -E option:
>> > >
>> > > ~ $: java -jar ../apache-rat-0.8/apache-rat-**0.8.jar -E
>> ./.rat-ignore -d
>> > > ./
>> > > Exception in thread "main" java.util.regex.**PatternSyntaxException:
>> > > Dangling meta character '*' near index 0
>> > > **/setup.cfg
>> > > ^
>> > >         at java.util.regex.Pattern.error(**Pattern.java:1924)
>> > >         at java.util.regex.Pattern.**sequence(Pattern.java:2090)
>> > >         at java.util.regex.Pattern.expr(**Pattern.java:1964)
>> > >         at java.util.regex.Pattern.**compile(Pattern.java:1665)
>> > >         at java.util.regex.Pattern.<init>**(Pattern.java:1337)
>> > >         at java.util.regex.Pattern.**compile(Pattern.java:1022)
>> > >         at org.apache.commons.io.**filefilter.RegexFileFilter.<**
>> > > init>(RegexFileFilter.java:62)
>> > >         at org.apache.rat.Report.main(**Report.java:109)
>> > >
>> > > .rat-ignore file's content is:
>> > >
>> > > .rat-ignore
>> > > **/setup.cfg
>> > > **/*.json
>> > > Makefile.def.buildbot
>> > > requirements*
>> > > **/MANIFEST.in
>> > > Allura/allura/controllers/**controller.template
>> > > Allura/allura/etc/mime.types
>> > > Allura/allura/tests/data/**genshi_hello_tmpl
>> > > Allura/allura/tests/data/test_**mime/text_file.txt
>> > > ForgeGit/forgegit/data/post-**receive_tmpl
>> > > ForgeGit/forgegit/tests/data/
>> > > ForgeSVN/forgesvn/tests/data/
>> > >
>> > > Do I miss something? I've modelled the file after examples given at
>> > > http://ci.apache.org/projects/**rat-master-summary.html<
>> > http://ci.apache.org/projects/rat-master-summary.html>
>> > >
>> >
>> > It looks like Apache RAT 0.8 uses standard Java wildcard regex file
>> > matching, whereas the original RAT used a different set of wildcard
>> > meta-characters - more like the syntax used by Maven and Ant.
>> >
>> > The intended wildcard support does not appear to be documented
>> anywhere, so
>> > it's not clear whether the change is intentional or not.
>> >
>> > If you are running RAT from Ant or Maven I think they interpret the
>> > patterns using their own wildcard scheme.
>> >
>>
>>
>>
>> --
>> "That's what prayers are ... it's frightened people trying to make friends
>> with the bully!"
>>
>> Terry Pratchett. The Last Hero
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message