Menu

CPD - filter out files

Delmas
2012-03-02
2012-10-07
  • Delmas

    Delmas - 2012-03-02

    Hello,

    When working on a project, some files must not be checked, for example, test
    or generated code.
    It would then be usefull to be able to filter out some files, based on their
    path name. Just like the "--files" option, one could specify a folder or a
    specific file to discard.

    Examples:
    --exclude=/path/to/generated/
    --exclude=myfile.cpp

    Best regards,

    Remi

     
  • Romain PELISSE

    Romain PELISSE - 2012-03-02

    I can't check for now, but I'm pretty sure those options exist. Did you chek
    the help text of CPD ?

     
  • Delmas

    Delmas - 2012-03-05

    Help text shows:

    Usage:
    java net.sourceforge.pmd.cpd.CPD --minimum-tokens xxx --files xxx
    i.e:
    java net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files
    c:\jdk14\src\java
    or:
    java net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files /path/to/c/code
    --language c
    or:
    java net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --encoding UTF-16LE
    --files /path/to/java/code --format xml

    Also, looking at CPD.java from the 5.0-java release, I am pretty sure this is
    not done. I did not check the latest code, though.

     
  • mikolg

    mikolg - 2012-03-13

    It would be nice if exclude filter supports regular expression of file mask.
    For example --exclude "*/Designer.cs"

     

Log in to post a comment.

MongoDB Logo MongoDB