Skip to content

Commit 20bfc63

Browse files
Merge remote-tracking branch 'origin/cleaning' into cleaning
2 parents 201d266 + 8b11d35 commit 20bfc63

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

docs/replication/create-forks-on-github.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,16 @@ while IFS= read -d '' -r repository
5454
do
5555
echo
5656
run cd "$repository"
57-
run gh repo fork --remote
58-
run git push -f origin
57+
url="$(git remote get-url origin)"
58+
if [[ "$url" ~= github.com ]]
59+
then
60+
echo "$repository is a github repo"
61+
run gh repo fork --remote
62+
run git push -f origin
63+
else
64+
echo "$repository is not a github repo"
65+
run gh repo create "$repository" -d "Fork of $url" --push --public --source .
66+
fi
5967
done
6068

6169
if [ "$was_logged_in" = "1" ]

src/main/java/org/variantsync/diffdetective/datasets/DatasetDescription.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.variantsync.diffdetective.datasets;
22

3+
import org.tinylog.Logger;
34
import org.variantsync.diffdetective.util.LaTeX;
45
import org.variantsync.diffdetective.util.StringUtils;
56

@@ -47,6 +48,17 @@ public static List<DatasetDescription> fromMarkdown(final Path markdownFile) thr
4748
return lines
4849
.skip(2) // Skip header
4950
.map(line -> line.split("\\|"))
51+
.filter(cells -> {
52+
if (cells.length != 7) {
53+
Logger.error("Skipping ill-formed line "
54+
+ String.join("|", cells)
55+
+ "! Expected 7 entries in a table (separated by |) but got "
56+
+ cells.length
57+
+ "!");
58+
return false;
59+
}
60+
return true;
61+
})
5062
.filter(cells ->
5163
isYes(cells[2]) && // hasCode
5264
isYes(cells[3]) // isGitRepo

src/main/java/org/variantsync/diffdetective/validation/Validation.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.variantsync.diffdetective.util.Assert;
2222

2323
import java.io.IOException;
24+
import java.nio.file.Files;
2425
import java.nio.file.Path;
2526
import java.nio.file.Paths;
2627
import java.util.List;
@@ -131,10 +132,14 @@ public static void main(String[] args) throws IOException {
131132
if (args.length < 1) {
132133
datasetsFile = DefaultDatasets.DEFAULT_DATASETS_FILE;
133134
} else if (args.length > 1) {
134-
System.err.println("Error: Expected exactly one argument but got " + args.length + "! Expected a path to a datasets markdown file.");
135+
Logger.error("Error: Expected exactly one argument but got " + args.length + "! Expected a path to a datasets markdown file.");
135136
return;
136137
} else {
137138
datasetsFile = Path.of(args[0]);
139+
140+
if (!Files.exists(datasetsFile)) {
141+
Logger.error("The given datasets file \"" + datasetsFile + "\" does not exist.");
142+
}
138143
}
139144

140145
final ParseOptions.DiffStoragePolicy diffStoragePolicy = ParseOptions.DiffStoragePolicy.DO_NOT_REMEMBER;

0 commit comments

Comments
 (0)