creadur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis Lundberg (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (RAT-161) Support exclusion of paths: "path/to/file.ext"
Date Tue, 10 Jun 2014 13:41:01 GMT

    [ https://issues.apache.org/jira/browse/RAT-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14026438#comment-14026438
] 

Dennis Lundberg commented on RAT-161:
-------------------------------------

Hi Erik,

First some questions that are not really related to your question. Are you using Rat from
the command line today? What build tool is Spark using? Perhaps it would be easier for you
to use either the Ant task or Maven plugin for Rat.

As far as I understand it, the -E option specifies a file that contains regular expressions
which are then used as exclude patterns. There is also the -e option which can be used to
specify an exclude pattern directly. Some examples might explain better:

{noformat}
rat -E file-that-contains-regular-expressions
rat -e pattern-for-files-that-should-be-excluded
{noformat}

Over at the Maven project we use the Maven plugin to run Rat, and there we use the excludes
configuration, which corresponds to the -e option, see http://creadur.apache.org/rat/apache-rat-plugin/check-mojo.html#excludes

Here is an example:

{code:xml}
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <configuration>
            <excludes>
              <!--
                This file must not contain a license header, because the test is
                supposed to report an error because of a missing license header.
              -->
              <exclude>src/it/multi-modules-aggregate/child-b/src/test/java/org/apache/maven/plugins/checkstyle/its/AppTest.java</exclude>
              <!--
                These are license header templates.
              -->
              <exclude>src/main/resources/config/maven-header.txt</exclude>
              <exclude>src/it/MCHECKSTYLE-225-customHeader/build-tools/src/main/resources/test/custom-header.txt</exclude>
              <exclude>src/it/MCHECKSTYLE-225-LICENSE.txt/build-tools/src/main/resources/LICENSE.txt</exclude>
              <!--
                File from the Checkstyle distribution - do not add our own license header.
              -->
              <exclude>src/main/resources/config/sun_checks.xml</exclude>
            </excludes>
          </configuration>
        </plugin>
{code}


Note that the code you referred to in SPARK-1493 is a very old branch from when Rat was first
accepted into the Incubator. Current code is in svn here: http://svn.apache.org/viewvc/creadur/rat/trunk/

> Support exclusion of paths:   "path/to/file.ext"
> ------------------------------------------------
>
>                 Key: RAT-161
>                 URL: https://issues.apache.org/jira/browse/RAT-161
>             Project: Apache Rat
>          Issue Type: New Feature
>          Components: reports
>            Reporter: Erik Erlandson
>            Priority: Minor
>             Fix For: 0.11
>
>
> It would be advantageous to be able to exclude specific files, e.g. "path/to/file.ext"
> The current '-E' feature cannot do this, as the filter patterns are only applied to individual
files as directory tree is traversed, so a filter will never see "path/to/file.ext", only
"path", "to" and "file.ext"
> See for example: SPARK-1493



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message