More API cleanups
This commit is contained in:
parent
158167bebd
commit
e9f3079911
2 changed files with 38 additions and 23 deletions
|
@ -149,7 +149,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public DetektOperation basePath(Path path) {
|
public DetektOperation basePath(Path path) {
|
||||||
return basePath(path.toFile());
|
return basePath(path.toFile().getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -183,7 +183,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public DetektOperation baseline(Path baseline) {
|
public DetektOperation baseline(Path baseline) {
|
||||||
return baseline(baseline.toFile());
|
return baseline(baseline.toFile().getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -214,6 +214,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths one or more files
|
* @param paths one or more files
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #classPath(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation classPath(File... paths) {
|
public DetektOperation classPath(File... paths) {
|
||||||
return classPath(List.of(paths));
|
return classPath(List.of(paths));
|
||||||
|
@ -225,6 +226,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths one or more files
|
* @param paths one or more files
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #classPathPaths(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation classPath(Path... paths) {
|
public DetektOperation classPath(Path... paths) {
|
||||||
return classPathPaths(List.of(paths));
|
return classPathPaths(List.of(paths));
|
||||||
|
@ -236,6 +238,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths one or more files
|
* @param paths one or more files
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #classPathStrings(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation classPath(String... paths) {
|
public DetektOperation classPath(String... paths) {
|
||||||
return classPathStrings(List.of(paths));
|
return classPathStrings(List.of(paths));
|
||||||
|
@ -248,6 +251,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths the paths
|
* @param paths the paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #classPath(File...)
|
||||||
*/
|
*/
|
||||||
public DetektOperation classPath(Collection<File> paths) {
|
public DetektOperation classPath(Collection<File> paths) {
|
||||||
classpath_.addAll(paths);
|
classpath_.addAll(paths);
|
||||||
|
@ -269,10 +273,10 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths the paths
|
* @param paths the paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #classPath(Path...)
|
||||||
*/
|
*/
|
||||||
public DetektOperation classPathPaths(Collection<Path> paths) {
|
public DetektOperation classPathPaths(Collection<Path> paths) {
|
||||||
classpath_.addAll(paths.stream().map(Path::toFile).toList());
|
return classPath(paths.stream().map(Path::toFile).toList());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -281,10 +285,10 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths the paths
|
* @param paths the paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #classPath(String...)
|
||||||
*/
|
*/
|
||||||
public DetektOperation classPathStrings(Collection<String> paths) {
|
public DetektOperation classPathStrings(Collection<String> paths) {
|
||||||
classpath_.addAll(paths.stream().map(File::new).toList());
|
return classPath(paths.stream().map(File::new).toList());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -292,6 +296,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param configs one or more config files
|
* @param configs one or more config files
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #config(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation config(File... configs) {
|
public DetektOperation config(File... configs) {
|
||||||
return config(List.of(configs));
|
return config(List.of(configs));
|
||||||
|
@ -302,6 +307,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param configs one or more config files
|
* @param configs one or more config files
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #configPaths(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation config(Path... configs) {
|
public DetektOperation config(Path... configs) {
|
||||||
return configPaths(List.of(configs));
|
return configPaths(List.of(configs));
|
||||||
|
@ -312,6 +318,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param configs one or more config files
|
* @param configs one or more config files
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #configStrings(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation config(String... configs) {
|
public DetektOperation config(String... configs) {
|
||||||
return configStrings(List.of(configs));
|
return configStrings(List.of(configs));
|
||||||
|
@ -323,6 +330,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param configs the config files
|
* @param configs the config files
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #config(File...)
|
||||||
*/
|
*/
|
||||||
public DetektOperation config(Collection<File> configs) {
|
public DetektOperation config(Collection<File> configs) {
|
||||||
config_.addAll(configs);
|
config_.addAll(configs);
|
||||||
|
@ -343,10 +351,10 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param configs the config files
|
* @param configs the config files
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #config(Path...)
|
||||||
*/
|
*/
|
||||||
public DetektOperation configPaths(Collection<Path> configs) {
|
public DetektOperation configPaths(Collection<Path> configs) {
|
||||||
config_.addAll(configs.stream().map(Path::toFile).toList());
|
return config(configs.stream().map(Path::toFile).toList());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -377,7 +385,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public DetektOperation configResource(Path resource) {
|
public DetektOperation configResource(Path resource) {
|
||||||
return configResource(resource.toFile());
|
return configResource(resource.toFile().getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -394,6 +402,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param configs the config files
|
* @param configs the config files
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #config(String...)
|
||||||
*/
|
*/
|
||||||
public DetektOperation configStrings(Collection<String> configs) {
|
public DetektOperation configStrings(Collection<String> configs) {
|
||||||
config_.addAll(configs.stream().map(File::new).toList());
|
config_.addAll(configs.stream().map(File::new).toList());
|
||||||
|
@ -441,8 +450,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public DetektOperation excludes(String... patterns) {
|
public DetektOperation excludes(String... patterns) {
|
||||||
excludes_.addAll(List.of(patterns));
|
return excludes(List.of(patterns));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -705,8 +713,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public DetektOperation includes(String... patterns) {
|
public DetektOperation includes(String... patterns) {
|
||||||
includes_.addAll(List.of(patterns));
|
return includes(List.of(patterns));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -735,6 +742,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths the paths
|
* @param paths the paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #input(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation input(Collection<File> paths) {
|
public DetektOperation input(Collection<File> paths) {
|
||||||
input_.addAll(paths);
|
input_.addAll(paths);
|
||||||
|
@ -746,6 +754,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths one or more paths
|
* @param paths one or more paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #inputStrings(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation input(String... paths) {
|
public DetektOperation input(String... paths) {
|
||||||
return inputStrings(List.of(paths));
|
return inputStrings(List.of(paths));
|
||||||
|
@ -756,6 +765,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths one or more paths
|
* @param paths one or more paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #input(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation input(File... paths) {
|
public DetektOperation input(File... paths) {
|
||||||
return input(List.of(paths));
|
return input(List.of(paths));
|
||||||
|
@ -766,6 +776,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths one or more paths
|
* @param paths one or more paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #inputPaths(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation input(Path... paths) {
|
public DetektOperation input(Path... paths) {
|
||||||
return inputPaths(List.of(paths));
|
return inputPaths(List.of(paths));
|
||||||
|
@ -785,10 +796,10 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths the paths
|
* @param paths the paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #input(Path...)
|
||||||
*/
|
*/
|
||||||
public DetektOperation inputPaths(Collection<Path> paths) {
|
public DetektOperation inputPaths(Collection<Path> paths) {
|
||||||
input_.addAll(paths.stream().map(Path::toFile).toList());
|
return input(paths.stream().map(Path::toFile).toList());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -796,10 +807,10 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param paths the paths
|
* @param paths the paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #input(String...)
|
||||||
*/
|
*/
|
||||||
public DetektOperation inputStrings(Collection<String> paths) {
|
public DetektOperation inputStrings(Collection<String> paths) {
|
||||||
input_.addAll(paths.stream().map(File::new).toList());
|
return input(paths.stream().map(File::new).toList());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -879,6 +890,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param jars one or more jars
|
* @param jars one or more jars
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #pluginsStrings(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation plugins(String... jars) {
|
public DetektOperation plugins(String... jars) {
|
||||||
return pluginsStrings(List.of(jars));
|
return pluginsStrings(List.of(jars));
|
||||||
|
@ -889,6 +901,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param jars one or more jars
|
* @param jars one or more jars
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #plugins(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation plugins(File... jars) {
|
public DetektOperation plugins(File... jars) {
|
||||||
return plugins(List.of(jars));
|
return plugins(List.of(jars));
|
||||||
|
@ -899,6 +912,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param jars one or more jars
|
* @param jars one or more jars
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #pluginsPaths(Collection)
|
||||||
*/
|
*/
|
||||||
public DetektOperation plugins(Path... jars) {
|
public DetektOperation plugins(Path... jars) {
|
||||||
return pluginsPaths(List.of(jars));
|
return pluginsPaths(List.of(jars));
|
||||||
|
@ -909,6 +923,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param jars the jars paths
|
* @param jars the jars paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #input(File...)
|
||||||
*/
|
*/
|
||||||
public DetektOperation plugins(Collection<File> jars) {
|
public DetektOperation plugins(Collection<File> jars) {
|
||||||
plugins_.addAll(jars);
|
plugins_.addAll(jars);
|
||||||
|
@ -929,10 +944,10 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param jars the jars paths
|
* @param jars the jars paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #plugins(Path...)
|
||||||
*/
|
*/
|
||||||
public DetektOperation pluginsPaths(Collection<Path> jars) {
|
public DetektOperation pluginsPaths(Collection<Path> jars) {
|
||||||
plugins_.addAll(jars.stream().map(Path::toFile).toList());
|
return plugins(jars.stream().map(Path::toFile).toList());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -940,10 +955,10 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
*
|
*
|
||||||
* @param jars the jars paths
|
* @param jars the jars paths
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
|
* @see #plugins(String...)
|
||||||
*/
|
*/
|
||||||
public DetektOperation pluginsStrings(Collection<String> jars) {
|
public DetektOperation pluginsStrings(Collection<String> jars) {
|
||||||
plugins_.addAll(jars.stream().map(File::new).toList());
|
return plugins(jars.stream().map(File::new).toList());
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -71,7 +71,7 @@ class DetektOperationTest {
|
||||||
op = op.basePath(bar.toPath());
|
op = op.basePath(bar.toPath());
|
||||||
assertThat(op.basePath()).as("as path").isEqualTo(bar.getAbsolutePath());
|
assertThat(op.basePath()).as("as path").isEqualTo(bar.getAbsolutePath());
|
||||||
|
|
||||||
op = new DetektOperation().basePath("foo");
|
op = op.basePath("foo");
|
||||||
assertThat(op.basePath()).as("as string").isEqualTo("foo");
|
assertThat(op.basePath()).as("as string").isEqualTo("foo");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ class DetektOperationTest {
|
||||||
op = op.baseline(bar.toPath());
|
op = op.baseline(bar.toPath());
|
||||||
assertThat(op.baseline()).as("as path").isEqualTo(bar.getAbsolutePath());
|
assertThat(op.baseline()).as("as path").isEqualTo(bar.getAbsolutePath());
|
||||||
|
|
||||||
op = new DetektOperation().baseline("foo");
|
op = op.baseline("foo");
|
||||||
assertThat(op.baseline()).as("as string").isEqualTo("foo");
|
assertThat(op.baseline()).as("as string").isEqualTo("foo");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue