Minor cleanup
This commit is contained in:
parent
4382b83b8c
commit
d55fd4704e
2 changed files with 31 additions and 42 deletions
12
.idea/misc.xml
generated
12
.idea/misc.xml
generated
|
@ -1,8 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="EntryPointsManager">
|
<component name="EntryPointsManager">
|
||||||
<pattern value="rife.bld.extension.DetektOperationBuild" method="pmd" />
|
<pattern value="rife.bld.extension.DetektOperationBuild" method="pmd" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PDMPlugin">
|
<component name="PDMPlugin">
|
||||||
|
<option name="customRuleSets">
|
||||||
|
<list>
|
||||||
|
<option value="K:\java\semver\config\pmd.xml" />
|
||||||
|
<option value="$PROJECT_DIR$/../bld-generated-version/config/pmd.xml" />
|
||||||
|
<option value="$PROJECT_DIR$/../bld-pitest/config/pmd.xml" />
|
||||||
|
<option value="$PROJECT_DIR$/../bld-jacoco-report/config/pmd.xml" />
|
||||||
|
<option value="$PROJECT_DIR$/../bld-checkstyle/config/pmd.xml" />
|
||||||
|
<option value="$PROJECT_DIR$/../bld-exec/config/pmd.xml" />
|
||||||
|
<option value="$PROJECT_DIR$/../bld-testng/config/pmd.xml" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
<option name="skipTestSources" value="false" />
|
<option name="skipTestSources" value="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
|
|
|
@ -34,45 +34,22 @@ import java.util.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
private static final List<String> DETEKT_JARS = List.of(
|
private static final List<String> DETEKT_JARS = List.of(
|
||||||
"detekt-cli-",
|
|
||||||
"jcommander-",
|
|
||||||
"detekt-core-",
|
|
||||||
"detekt-rules-",
|
|
||||||
"detekt-rules-errorprone-",
|
|
||||||
"detekt-tooling-",
|
|
||||||
"detekt-parser-",
|
|
||||||
"detekt-report-md-",
|
|
||||||
"detekt-metrics-",
|
|
||||||
"detekt-api-",
|
|
||||||
"detekt-psi-utils-",
|
|
||||||
"kotlin-compiler-embeddable-",
|
|
||||||
"kotlin-reflect-",
|
|
||||||
"detekt-report-html-",
|
|
||||||
"detekt-report-txt-",
|
|
||||||
"detekt-report-xml-",
|
|
||||||
"detekt-report-sarif-",
|
|
||||||
"detekt-utils-",
|
|
||||||
"detekt-rules-complexity-",
|
|
||||||
"detekt-rules-coroutines-",
|
|
||||||
"detekt-rules-documentation-",
|
|
||||||
"detekt-rules-empty-",
|
|
||||||
"detekt-rules-exceptions-",
|
|
||||||
"detekt-rules-naming-",
|
|
||||||
"detekt-rules-performance-",
|
|
||||||
"detekt-rules-style-",
|
|
||||||
"sarif4k-jvm-",
|
|
||||||
"kotlinx-serialization-json-jvm-",
|
|
||||||
"kotlinx-serialization-core-jvm-",
|
|
||||||
"kotlin-stdlib-jdk8-",
|
|
||||||
"kotlin-stdlib-jdk7-",
|
|
||||||
"kotlin-stdlib-",
|
|
||||||
"contester-breakpoint-",
|
|
||||||
"kotlin-script-runtime-",
|
|
||||||
"kotlin-daemon-embeddable-",
|
|
||||||
"trove4j-",
|
|
||||||
"annotations-",
|
"annotations-",
|
||||||
|
"contester-breakpoint-",
|
||||||
|
"detekt-",
|
||||||
|
"jcommander-",
|
||||||
|
"kotlin-compiler-embeddable-",
|
||||||
|
"kotlin-daemon-embeddable-",
|
||||||
|
"kotlin-reflect-",
|
||||||
|
"kotlin-script-runtime-",
|
||||||
|
"kotlin-stdlib-",
|
||||||
|
"kotlin-stdlib-jdk7-",
|
||||||
|
"kotlin-stdlib-jdk8-",
|
||||||
|
"kotlinx-html-jvm-",
|
||||||
|
"kotlinx-serialization-",
|
||||||
|
"sarif4k-jvm-",
|
||||||
"snakeyaml-engine-",
|
"snakeyaml-engine-",
|
||||||
"kotlinx-html-jvm-");
|
"trove4j-");
|
||||||
private static final Logger LOGGER = Logger.getLogger(DetektReport.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(DetektReport.class.getName());
|
||||||
private final Collection<String> classpath_ = new ArrayList<>();
|
private final Collection<String> classpath_ = new ArrayList<>();
|
||||||
private final Collection<String> config_ = new ArrayList<>();
|
private final Collection<String> config_ = new ArrayList<>();
|
||||||
|
@ -310,13 +287,13 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
// classpath
|
// classpath
|
||||||
if (!classpath_.isEmpty()) {
|
if (!classpath_.isEmpty()) {
|
||||||
args.add("--classpath");
|
args.add("--classpath");
|
||||||
args.add(String.join(File.pathSeparator, classpath_));
|
args.add(String.join(File.pathSeparator, classpath_.stream().filter(this::isNotBlank).toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// config
|
// config
|
||||||
if (!config_.isEmpty()) {
|
if (!config_.isEmpty()) {
|
||||||
args.add("-config");
|
args.add("-config");
|
||||||
args.add(String.join(";", config_));
|
args.add(String.join(";", config_.stream().filter(this::isNotBlank).toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// config-resource
|
// config-resource
|
||||||
|
@ -360,7 +337,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
// input
|
// input
|
||||||
if (!input_.isEmpty()) {
|
if (!input_.isEmpty()) {
|
||||||
args.add("--input");
|
args.add("--input");
|
||||||
args.add(String.join(",", input_));
|
args.add(String.join(",", input_.stream().filter(this::isNotBlank).toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// jdk-home
|
// jdk-home
|
||||||
|
@ -395,7 +372,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
// plugins
|
// plugins
|
||||||
if (!plugins_.isEmpty()) {
|
if (!plugins_.isEmpty()) {
|
||||||
args.add("--plugins");
|
args.add("--plugins");
|
||||||
args.add(String.join(".", plugins_));
|
args.add(String.join(",", plugins_.stream().filter(this::isNotBlank).toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// report
|
// report
|
||||||
|
@ -407,7 +384,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LOGGER.isLoggable(Level.FINE)) {
|
if (LOGGER.isLoggable(Level.FINE)) {
|
||||||
LOGGER.fine(String.join(" ", args));
|
LOGGER.fine(String.join(" ", args.stream().filter(this::isNotBlank).toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return args;
|
return args;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue