Delete old CPD Language interface
reorganize cpd modules
This commit is contained in:
@ -1,19 +0,0 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.cpd;
|
||||
|
||||
/**
|
||||
* Defines the Language module for Python
|
||||
*/
|
||||
public class PythonLanguage extends AbstractLanguage {
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link PythonLanguage} with the default
|
||||
* extensions for python files.
|
||||
*/
|
||||
public PythonLanguage() {
|
||||
super("Python", "python", new PythonTokenizer(), ".py");
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.lang.python;
|
||||
|
||||
import net.sourceforge.pmd.lang.python.cpd.PythonTokenizer;
|
||||
import net.sourceforge.pmd.cpd.Tokenizer;
|
||||
import net.sourceforge.pmd.lang.CpdOnlyLanguageModuleBase;
|
||||
import net.sourceforge.pmd.lang.LanguagePropertyBundle;
|
||||
|
||||
/**
|
||||
* Defines the Language module for Python
|
||||
*/
|
||||
public class PythonLanguageModule extends CpdOnlyLanguageModuleBase {
|
||||
|
||||
public PythonLanguageModule() {
|
||||
super(LanguageMetadata.withId("python").name("Python").extensions("py"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tokenizer createCpdTokenizer(LanguagePropertyBundle bundle) {
|
||||
return new PythonTokenizer();
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
/**
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.cpd;
|
||||
package net.sourceforge.pmd.lang.python.cpd;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
@ -1 +0,0 @@
|
||||
net.sourceforge.pmd.cpd.PythonLanguage
|
@ -0,0 +1 @@
|
||||
net.sourceforge.pmd.lang.python.PythonLanguageModule
|
@ -1,8 +1,8 @@
|
||||
/**
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.cpd;
|
||||
package net.sourceforge.pmd.lang.python.cpd;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -11,15 +11,9 @@ import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest;
|
||||
class PythonTokenizerTest extends CpdTextComparisonTest {
|
||||
|
||||
PythonTokenizerTest() {
|
||||
super(".py");
|
||||
super("python", ".py");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getResourcePrefix() {
|
||||
return "../lang/python/cpd/testdata";
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void sampleTest() {
|
||||
doTest("sample_python");
|
Reference in New Issue
Block a user