Rename classes
This commit is contained in:
1 parent
34729c28e5
commit
adb08a9838
5 files changed
+14
-14
No files matched your search
+1
-1
@@ -44,7 +44,7 @@
|
||||
<argument>--force</argument>
|
||||
<argument>--completionScript</argument>
|
||||
<argument>${project.build.directory}/pmd_completion.sh</argument>
|
||||
<argument>net.sourceforge.pmd.cli.commands.internal.PMDRootCommand</argument>
|
||||
<argument>net.sourceforge.pmd.cli.commands.internal.PmdRootCommand</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
package net.sourceforge.pmd.cli;
|
||||
|
||||
import net.sourceforge.pmd.cli.commands.internal.PMDRootCommand;
|
||||
import net.sourceforge.pmd.cli.commands.internal.PmdRootCommand;
|
||||
import picocli.CommandLine;
|
||||
import picocli.CommandLine.Command;
|
||||
import picocli.CommandLine.Option;
|
||||
|
||||
public class PMDCLI {
|
||||
public class PmdCli {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new CommandLine(new PMDRootCommand()).setCaseInsensitiveEnumValuesAllowed(true)
|
||||
new CommandLine(new PmdRootCommand()).setCaseInsensitiveEnumValuesAllowed(true)
|
||||
// .execute("run", "-h");
|
||||
.execute("run", "--use-version", "scala-2.11", "--use-version", "apex", "--use-version",
|
||||
"ecmascript-latest", "-P", "foo=bar", "-R", "foo,bar", "-R", "baz", "-d",
|
||||
@@ -16,7 +16,7 @@ public class PMDCLI {
|
||||
}
|
||||
|
||||
@Command(name = "cpd", mixinStandardHelpOptions = true, description = "The Copy Paste Detector")
|
||||
public static class CPDPicoCli implements Runnable {
|
||||
public static class CpdPicoCli implements Runnable {
|
||||
@SuppressWarnings("unused")
|
||||
@Option(names = "--minimum-tokens",
|
||||
description = "The minimum token length which should be reported as a duplicate.",
|
||||
+1
-1
@@ -7,7 +7,7 @@ import picocli.CommandLine.Model.CommandSpec;
|
||||
import picocli.CommandLine.Option;
|
||||
import picocli.CommandLine.Spec;
|
||||
|
||||
public abstract class AbstractPMDSubcommand implements Callable<Integer> {
|
||||
public abstract class AbstractPmdSubcommand implements Callable<Integer> {
|
||||
|
||||
@Spec
|
||||
protected CommandSpec spec; // injected by PicoCli, needed for validations
|
||||
+5
-5
@@ -25,7 +25,7 @@ import picocli.CommandLine.TypeConversionException;
|
||||
|
||||
@Command(name = "analyze", aliases = {"analyse", "run" }, showDefaultValues = true,
|
||||
description = "The PMD standard source code analyzer")
|
||||
public class PMDCommand extends AbstractPMDSubcommand {
|
||||
public class PmdCommand extends AbstractPmdSubcommand {
|
||||
|
||||
private List<String> rulesets;
|
||||
|
||||
@@ -202,7 +202,7 @@ public class PMDCommand extends AbstractPMDSubcommand {
|
||||
if (list.size() > 1) {
|
||||
throw new ParameterException(spec.commandLine(), "Can only set one version per language, "
|
||||
+ "but for language " + l.getName() + " multiple versions were provided "
|
||||
+ list.stream().map(PMDCommand::normalizeName).collect(Collectors.joining("', '", "'", "'")));
|
||||
+ list.stream().map(PmdCommand::normalizeName).collect(Collectors.joining("', '", "'", "'")));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -445,7 +445,7 @@ public class PMDCommand extends AbstractPMDSubcommand {
|
||||
|
||||
@Override
|
||||
public Iterator<String> iterator() {
|
||||
return LanguageRegistry.getLanguages().stream().map(PMDCommand::normalizeName).iterator();
|
||||
return LanguageRegistry.getLanguages().stream().map(PmdCommand::normalizeName).iterator();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,12 +477,12 @@ public class PMDCommand extends AbstractPMDSubcommand {
|
||||
public Iterator<String> iterator() {
|
||||
// Raw language names / -latest versions, such as "java" or "java-latest"
|
||||
final Stream<String> latestLangReferences = LanguageRegistry.getLanguages().stream()
|
||||
.map(PMDCommand::normalizeName).flatMap(name -> Stream.of(name, name + "-latest"));
|
||||
.map(PmdCommand::normalizeName).flatMap(name -> Stream.of(name, name + "-latest"));
|
||||
|
||||
// Explicit language-version pairs, such as "java-18" or "apex-54"
|
||||
final Stream<String> allLangVersionReferences = LanguageRegistry.getLanguages().stream()
|
||||
.flatMap(l -> l.getVersions().stream())
|
||||
.map(PMDCommand::normalizeName);
|
||||
.map(PmdCommand::normalizeName);
|
||||
|
||||
// Collect to a TreeSet to ensure alphabetical order
|
||||
final TreeSet<String> candidates = Stream.concat(latestLangReferences, allLangVersionReferences)
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package net.sourceforge.pmd.cli.commands.internal;
|
||||
|
||||
import net.sourceforge.pmd.PMDVersion;
|
||||
import net.sourceforge.pmd.cli.PMDCLI.CPDPicoCli;
|
||||
import net.sourceforge.pmd.cli.PmdCli.CpdPicoCli;
|
||||
import picocli.CommandLine.Command;
|
||||
import picocli.CommandLine.IVersionProvider;
|
||||
|
||||
@@ -10,8 +10,8 @@ import picocli.CommandLine.IVersionProvider;
|
||||
exitCodeListHeading = "Exit Codes:%n",
|
||||
exitCodeList = { "0:Succesful analysis, no violations found", "1:An unexpected error occurred during execution",
|
||||
"2:Usage error, please refer to the command help", "4:Successful analysis, at least 1 violation found" },
|
||||
subcommands = { PMDCommand.class, CPDPicoCli.class })
|
||||
public class PMDRootCommand {
|
||||
subcommands = { PmdCommand.class, CpdPicoCli.class })
|
||||
public class PmdRootCommand {
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user