Return-Path: X-Original-To: apmail-creadur-dev-archive@www.apache.org Delivered-To: apmail-creadur-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C1526FFAE for ; Sun, 7 Apr 2013 21:48:36 +0000 (UTC) Received: (qmail 45777 invoked by uid 500); 7 Apr 2013 21:48:36 -0000 Delivered-To: apmail-creadur-dev-archive@creadur.apache.org Received: (qmail 45743 invoked by uid 500); 7 Apr 2013 21:48:36 -0000 Mailing-List: contact dev-help@creadur.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@creadur.apache.org Delivered-To: mailing list dev@creadur.apache.org Received: (qmail 45734 invoked by uid 99); 7 Apr 2013 21:48:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Apr 2013 21:48:36 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sebbaz@gmail.com designates 209.85.212.171 as permitted sender) Received: from [209.85.212.171] (HELO mail-wi0-f171.google.com) (209.85.212.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Apr 2013 21:48:32 +0000 Received: by mail-wi0-f171.google.com with SMTP id hn17so2016244wib.16 for ; Sun, 07 Apr 2013 14:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=uxAyhuc5n4r4iI4k56EVVx1g9f/acs6v0ankWkIKIqA=; b=f/imSfrbfs5fCbfaUhDaJGDHHj6bOA2iBA4w9x2Em3F26EZ1lwSsKrTSV7HmBtjkSf 0Zr1dtBdNqAeoaHybACNDwKvcx5kyGYcwO1LZJD8Uz3+fhko9rNi4Fo4KX6WaQH57utL SU+LoJGSXvZ3gukX5pYINdtRaKlKZF906gTusDlf4DBKFEiN2yLw/flHu4FtOWGgwM+b 7ZkwG1D/TmZ6EzcTfCpbY6OhqubATcW2KnzHjdi9sMLPpMYSfRf0a7ElaTHT2VrxYHd6 A32s7HTxBma1dbvreA6e3Q+iw/MaYmcV/LldG1Fi/zQV3oUKzndamxbR0QvI9u1yCpqh cOBA== MIME-Version: 1.0 X-Received: by 10.194.93.68 with SMTP id cs4mr27799555wjb.17.1365371290763; Sun, 07 Apr 2013 14:48:10 -0700 (PDT) Received: by 10.194.243.10 with HTTP; Sun, 7 Apr 2013 14:48:10 -0700 (PDT) In-Reply-To: References: <515DD7BA.7080805@gmail.com> Date: Sun, 7 Apr 2013 22:48:10 +0100 Message-ID: Subject: Re: PatternSyntaxException when trying rat -E From: sebb To: dev@creadur.apache.org Content-Type: multipart/alternative; boundary=047d7b5d8cffc5c5f304d9cc46ce X-Virus-Checked: Checked by ClamAV on apache.org --047d7b5d8cffc5c5f304d9cc46ce Content-Type: text/plain; charset=ISO-8859-1 On 7 April 2013 20:09, Jochen Wiedmann 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 wrote: > > > On 4 April 2013 20:42, Peter Hartmann 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.**(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 > --047d7b5d8cffc5c5f304d9cc46ce--