Skip to content

Commit

Permalink
Fix stupid IDE formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tibetiroka committed Feb 26, 2024
1 parent 5234e53 commit bb695a3
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/main/java/com/tibetiroka/deblint/Linters.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,6 @@ class Linters {
}
}
};
protected static final BiConsumer<String, Configuration> SHA1_LINTER = (s, config) -> {
String[] lines = s.split("\\n");
if(!lines[0].isBlank()) {
Main.error("The first line of checksums should be empty");
}
Arrays.stream(lines).filter(s1 -> !s1.isBlank()).map(String::strip).forEachOrdered(l -> {
String[] parts = l.split(" ", 3);
if(parts.length < 3) {
Main.error("Missing parameter; 3 values required: " + l);
return;
}
if(!Pattern.matches("^[a-fA-F0-9]{40}$", parts[0])) {
Main.error("Invalid SHA hash: " + parts[0]);
}
SIZE_LINTER.accept(parts[1], config);
});
};
protected static final BiConsumer<String, Configuration> BINARY_LIST_LINTER = (s, config) -> {
HashSet<String> files = new HashSet<>();
if(config.checkedType == ControlType.SOURCE_CONTROL) {
Expand Down Expand Up @@ -409,6 +392,23 @@ class Linters {
Main.error("Invalid size: " + s);
}
};
protected static final BiConsumer<String, Configuration> SHA1_LINTER = (s, config) -> {
String[] lines = s.split("\\n");
if(!lines[0].isBlank()) {
Main.error("The first line of checksums should be empty");
}
Arrays.stream(lines).filter(s1 -> !s1.isBlank()).map(String::strip).forEachOrdered(l -> {
String[] parts = l.split(" ", 3);
if(parts.length < 3) {
Main.error("Missing parameter; 3 values required: " + l);
return;
}
if(!Pattern.matches("^[a-fA-F0-9]{40}$", parts[0])) {
Main.error("Invalid SHA hash: " + parts[0]);
}
SIZE_LINTER.accept(parts[1], config);
});
};
protected static final BiConsumer<String, Configuration> SHA256_LINTER = (s, config) -> {
String[] lines = s.split("\n");
if(!lines[0].isBlank()) {
Expand Down

0 comments on commit bb695a3

Please sign in to comment.