Add Perl support to CPD.
This commit is contained in:
@ -103,6 +103,11 @@
|
|||||||
<artifactId>pmd-matlab</artifactId>
|
<artifactId>pmd-matlab</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sourceforge.pmd</groupId>
|
||||||
|
<artifactId>pmd-perl</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sourceforge.pmd</groupId>
|
<groupId>net.sourceforge.pmd</groupId>
|
||||||
<artifactId>pmd-objectivec</artifactId>
|
<artifactId>pmd-objectivec</artifactId>
|
||||||
|
81
pmd-perl/pom.xml
Normal file
81
pmd-perl/pom.xml
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>pmd-perl</artifactId>
|
||||||
|
<name>PMD Perl</name>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>net.sourceforge.pmd</groupId>
|
||||||
|
<artifactId>pmd</artifactId>
|
||||||
|
<version>5.5.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<config.basedir>${basedir}/../pmd-core</config.basedir>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${basedir}/src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<useDefaultDelimiters>false</useDefaultDelimiters>
|
||||||
|
<delimiters>
|
||||||
|
<delimiter>${*}</delimiter>
|
||||||
|
</delimiters>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>net.sourceforge.pmd</groupId>
|
||||||
|
<artifactId>pmd-build</artifactId>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>pmd-clean</id>
|
||||||
|
<phase>clean</phase>
|
||||||
|
<configuration>
|
||||||
|
<target>
|
||||||
|
<echo>PMD specific tasks: cleaning generated markdown</echo>
|
||||||
|
<delete quiet="true">
|
||||||
|
<fileset dir="${basedir}/src/site/markdown/rules/" includes="**/*.md" />
|
||||||
|
<fileset dir="${basedir}/src/site/markdown/" includes="mergedruleset.xml" />
|
||||||
|
<fileset dir="${basedir}/src/site/" includes="site.xml" />
|
||||||
|
</delete>
|
||||||
|
</target>
|
||||||
|
</configuration>
|
||||||
|
<goals>
|
||||||
|
<goal>run</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sourceforge.pmd</groupId>
|
||||||
|
<artifactId>pmd-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mozilla</groupId>
|
||||||
|
<artifactId>rhino</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sourceforge.pmd</groupId>
|
||||||
|
<artifactId>pmd-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||||
|
*/
|
||||||
|
package net.sourceforge.pmd.cpd;
|
||||||
|
|
||||||
|
public class PerlLanguage extends AbstractLanguage {
|
||||||
|
public PerlLanguage() {
|
||||||
|
super("Perl", "perl", new PerlTokenizer(), ".pm", ".pl", ".t");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||||
|
*/
|
||||||
|
package net.sourceforge.pmd.cpd;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class PerlTokenizer extends AbstractTokenizer {
|
||||||
|
public PerlTokenizer() {
|
||||||
|
this.stringToken = new ArrayList<>();
|
||||||
|
this.stringToken.add( "\'" );
|
||||||
|
this.stringToken.add( "\"" );
|
||||||
|
|
||||||
|
this.ignorableCharacter = new ArrayList<>();
|
||||||
|
|
||||||
|
this.ignorableStmt = new ArrayList<>();
|
||||||
|
|
||||||
|
this.spanMultipleLinesString = true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
net.sourceforge.pmd.cpd.PerlLanguage
|
5
pmd-perl/src/site/markdown/index.md
Normal file
5
pmd-perl/src/site/markdown/index.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# PMD Perl
|
||||||
|
|
||||||
|
Contains the PMD implementation to support the Perl programming language.
|
||||||
|
|
||||||
|
Only very basic CPD support is implemented currently.
|
23
pmd-perl/src/site/site.pre.xml
Normal file
23
pmd-perl/src/site/site.pre.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project
|
||||||
|
xmlns="http://maven.apache.org/DECORATION/1.1.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd"
|
||||||
|
name="PMD Perl">
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<menu ref="parent"/>
|
||||||
|
|
||||||
|
<!-- The rulesets part of navigation will be added during pre-site and the
|
||||||
|
list is build dynamically based on rulesets folder directory layout -->
|
||||||
|
|
||||||
|
|
||||||
|
<menu name="Rule Sets"/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- *********** -->
|
||||||
|
|
||||||
|
<menu ref="reports"/>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</project>
|
1
pom.xml
1
pom.xml
@ -932,6 +932,7 @@
|
|||||||
<module>pmd-jsp</module>
|
<module>pmd-jsp</module>
|
||||||
<module>pmd-matlab</module>
|
<module>pmd-matlab</module>
|
||||||
<module>pmd-objectivec</module>
|
<module>pmd-objectivec</module>
|
||||||
|
<module>pmd-perl</module>
|
||||||
<module>pmd-php</module>
|
<module>pmd-php</module>
|
||||||
<module>pmd-plsql</module>
|
<module>pmd-plsql</module>
|
||||||
<module>pmd-python</module>
|
<module>pmd-python</module>
|
||||||
|
Reference in New Issue
Block a user