< prev index next > test/src/main/java/org/openjdk/skara/test/CheckableRepository.java
Print this page
*/
package org.openjdk.skara.test;
import org.openjdk.skara.vcs.*;
- import java.io.*;
+ import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.*;
+ import java.util.Set;
public class CheckableRepository {
private static String markerLine = "The very first line\n";
private static Path checkableFile(Path path) throws IOException {
var checkableName = checkable.readLine();
return path.resolve(checkableName);
}
}
- public static Repository init(Path path, VCS vcs, Path appendableFilePath) throws IOException {
+ public static Repository init(Path path, VCS vcs, Path appendableFilePath, Set<String> checks) throws IOException {
var repo = Repository.init(path, vcs);
Files.createDirectories(path.resolve(".checkable"));
try (var output = Files.newBufferedWriter(path.resolve(".checkable/name.txt"))) {
output.write(appendableFilePath.toString());
try (var output = Files.newBufferedWriter(checkConf)) {
output.append("[general]\n");
output.append("project=test\n");
output.append("\n");
output.append("[checks]\n");
- output.append("error=author,reviewers,whitespace\n");
- output.append("\n");
+ output.append("error=");
+ output.append(String.join(",", checks));
+ output.append("\n\n");
output.append("[census]\n");
output.append("version=0\n");
output.append("domain=openjdk.java.net\n");
output.append("\n");
output.append("[checks \"whitespace\"]\n");
repo.commit("Initial commit", "testauthor", "ta@none.none");
return repo;
}
+ public static Repository init(Path path, VCS vcs, Path appendableFilePath) throws IOException {
+ return init(path, vcs, appendableFilePath, Set.of("author", "reviewers", "whitespace"));
+ }
+
public static Repository init(Path path, VCS vcs) throws IOException {
return init(path, vcs, Path.of("appendable.txt"));
}
public static Hash appendAndCommit(Repository repo) throws IOException {
< prev index next >