Skip to content

Commit

Permalink
Enable google-java-format for Java files (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurpg authored Oct 17, 2021
1 parent ca8845a commit e331ee3
Show file tree
Hide file tree
Showing 30 changed files with 508 additions and 445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@

import static munit.internal.junitinterface.Ansi.*;

abstract class AbstractEvent implements Event
{
abstract class AbstractEvent implements Event {
protected final String ansiName;
protected final String ansiMsg;
protected final Status status;
protected final Throwable error;
private final Fingerprint fingerprint;
private final Long duration;

AbstractEvent(String ansiName, String ansiMsg, Status status, Fingerprint fingerprint, Long duration, Throwable error)
{
AbstractEvent(
String ansiName,
String ansiMsg,
Status status,
Fingerprint fingerprint,
Long duration,
Throwable error) {
this.fingerprint = fingerprint;
this.ansiName = ansiName;
this.ansiMsg = ansiMsg;
Expand Down Expand Up @@ -47,7 +51,7 @@ public Status status() {

@Override
public OptionalThrowable throwable() {
if( error == null ) {
if (error == null) {
return new OptionalThrowable();
} else {
return new OptionalThrowable(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,22 @@ public class Ansi {
private static final String LIGHT_MAGENTA = "\u001B[95m";
private static final String LIGHT_CYAN = "\u001B[96m";

public static String c(String s, String colorSequence)
{
if(colorSequence == null) return s;
public static String c(String s, String colorSequence) {
if (colorSequence == null) return s;
else return colorSequence + s + NORMAL;
}

public static String filterAnsi(String s)
{
if(s == null) return null;
public static String filterAnsi(String s) {
if (s == null) return null;
int len = s.length();
StringBuilder b = new StringBuilder(len);
for(int i=0; i<len; i++)
{
for (int i = 0; i < len; i++) {
char c = s.charAt(i);
if(c == '\u001B')
{
do { i++; } while(s.charAt(i) != 'm');
}
else b.append(c);
if (c == '\u001B') {
do {
i++;
} while (s.charAt(i) != 'm');
} else b.append(c);
}
return b.toString();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package munit.internal.junitinterface;

public interface Configurable {
public void configure(Settings settings);
public void configure(Settings settings);
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public boolean requireNoArgConstructor() {

@Override
public String toString() {
return "CustomFingerprint{" +
"suite='" + suite + '\'' +
'}';
return "CustomFingerprint{" + "suite='" + suite + '\'' + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ public CustomRunners(List<CustomFingerprint> runners) {
this.superclasses = new HashSet<>();
runners.forEach(runner -> this.superclasses.add(runner.suite));
}

public boolean isEmpty() {
return runners.isEmpty();
}

public Map<String, String> all() {
Map<String, String> result = new HashMap<>();
runners.forEach(runner -> result.put(runner.suite, runner.runner));
return result;
Map<String, String> result = new HashMap<>();
runners.forEach(runner -> result.put(runner.suite, runner.runner));
return result;
}

public boolean matchesFingerprint(Fingerprint fingerprint) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package munit.internal.junitinterface;


import java.util.Set;
import sbt.testing.Fingerprint;
import sbt.testing.SubclassFingerprint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ class EmptyRunner extends Runner {

private final Description desc;

EmptyRunner(Description desc) { this.desc = desc; }
EmptyRunner(Description desc) {
this.desc = desc;
}

@Override
public Description getDescription() { return desc; }
public Description getDescription() {
return desc;
}

@Override
public void run(RunNotifier notifier) {}
Expand Down
Loading

0 comments on commit e331ee3

Please sign in to comment.