S19: adopt shared mini-pc runner and landscape workflows
This commit is contained in:
@@ -9,7 +9,13 @@ import org.openrewrite.text.*;
|
||||
|
||||
/** Source-launcher bootstrap: no project-specific artifact is resolved or installed. */
|
||||
public class Format {
|
||||
public static void main(String[] args) throws Exception {
|
||||
/**
|
||||
* Checks or atomically formats configured handwritten Java sources with the pinned formatter.
|
||||
*
|
||||
* @param args consumer repository root followed by either {@code check} or {@code apply}
|
||||
* @throws Exception if configuration, parsing or formatting fails, or check mode finds differences
|
||||
*/
|
||||
public static void main(final String... args) throws Exception {
|
||||
Path root = Path.of(args[0]).toAbsolutePath().normalize();
|
||||
boolean check = switch (args[1]) {
|
||||
case "check" -> true;
|
||||
@@ -64,7 +70,7 @@ public class Format {
|
||||
.getChangeset()
|
||||
.getAllResults();
|
||||
for (Result result : results) {
|
||||
System.out.println((check ? "Needs formatting: " : "Formatted: ")
|
||||
IO.println((check ? "Needs formatting: " : "Formatted: ")
|
||||
+ result.getAfter().getSourcePath());
|
||||
}
|
||||
if (check && !results.isEmpty()) {
|
||||
@@ -96,8 +102,7 @@ public class Format {
|
||||
try (var output = Files.newOutputStream(cacheFile)) {
|
||||
cache.store(output, "Successfully formatted content only");
|
||||
}
|
||||
System.out.println(
|
||||
"Palantir " + args[1] + ": " + sources.size() + " Java files, " + results.size() + " differences");
|
||||
IO.println("Palantir " + args[1] + ": " + sources.size() + " Java files, " + results.size() + " differences");
|
||||
}
|
||||
|
||||
static String digest(String value) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user