Read parameters from resource file
This commit is contained in:
parent
1e62bc3fba
commit
7413565d87
3 changed files with 28 additions and 26 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
java -cp "lib/compile/*:examples/lib/bld/*" io.gitlab.arturbosch.detekt.cli.Main --help |\
|
java -cp "lib/compile/*:examples/lib/bld/*" io.gitlab.arturbosch.detekt.cli.Main --help |\
|
||||||
grep "^ --.*" |\
|
grep "^ --.*" |\
|
||||||
sed -e "s/ /\"/" -e "s/, .*//" -e "s/$/\",/" -e '/version/d' -e '/help/d' |\
|
sed -e "s/ //" -e "s/, .*//" -e '/version/d' -e '/help/d' |\
|
||||||
sort |\
|
sort |\
|
||||||
sed -e '$s/,//'
|
sed -e '$s/,//' > "src/test/resources/detekt-args.txt"
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ import rife.bld.operations.exceptions.ExitStatusException;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.logging.ConsoleHandler;
|
import java.util.logging.ConsoleHandler;
|
||||||
|
@ -59,30 +60,10 @@ class DetektOperationTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testCheckAllParameters() {
|
void testCheckAllParameters() throws IOException {
|
||||||
var params = List.of(
|
var params = Files.readAllLines(Paths.get("src", "test", "resources", "detekt-args.txt"));
|
||||||
"--all-rules",
|
|
||||||
"--auto-correct",
|
assertThat(params).isNotEmpty();
|
||||||
"--baseline",
|
|
||||||
"--base-path",
|
|
||||||
"--build-upon-default-config",
|
|
||||||
"--classpath",
|
|
||||||
"--config",
|
|
||||||
"--config-resource",
|
|
||||||
"--create-baseline",
|
|
||||||
"--debug",
|
|
||||||
"--disable-default-rulesets",
|
|
||||||
"--excludes",
|
|
||||||
"--generate-config",
|
|
||||||
"--includes",
|
|
||||||
"--input",
|
|
||||||
"--jdk-home",
|
|
||||||
"--jvm-target",
|
|
||||||
"--max-issues",
|
|
||||||
"--parallel",
|
|
||||||
"--plugins",
|
|
||||||
"--report"
|
|
||||||
);
|
|
||||||
|
|
||||||
var args = new DetektOperation()
|
var args = new DetektOperation()
|
||||||
.fromProject(new BaseProject())
|
.fromProject(new BaseProject())
|
||||||
|
|
21
src/test/resources/detekt-args.txt
Normal file
21
src/test/resources/detekt-args.txt
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
--all-rules
|
||||||
|
--auto-correct
|
||||||
|
--baseline
|
||||||
|
--base-path
|
||||||
|
--build-upon-default-config
|
||||||
|
--classpath
|
||||||
|
--config
|
||||||
|
--config-resource
|
||||||
|
--create-baseline
|
||||||
|
--debug
|
||||||
|
--disable-default-rulesets
|
||||||
|
--excludes
|
||||||
|
--generate-config
|
||||||
|
--includes
|
||||||
|
--input
|
||||||
|
--jdk-home
|
||||||
|
--jvm-target
|
||||||
|
--max-issues
|
||||||
|
--parallel
|
||||||
|
--plugins
|
||||||
|
--report
|
Loading…
Add table
Add a link
Reference in a new issue