Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable google-java-format for Java files #439

Merged
merged 2 commits into from
Oct 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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