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

Autoformat Java examples #3919

Merged
merged 42 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
40d5cf3
chore: add palantirformat target
myyk Nov 4, 2024
20f00f4
chore: format all the example java files
myyk Nov 7, 2024
02df45f
chore: clean up
myyk Nov 7, 2024
3812ea1
chore: fix the command in the github action
myyk Nov 7, 2024
b36d502
chore: don't extend PalantirFormatModule
myyk Nov 8, 2024
ed4cf47
revert: changes in linting examples
myyk Nov 8, 2024
99194b5
chore: add mechanism to skip lint on some java files
myyk Nov 8, 2024
7fc724d
revert: bring back some changes that were lost from rebase
myyk Nov 8, 2024
ad0b19e
.
myyk Nov 8, 2024
ef8a83c
test: fix example tests
myyk Nov 8, 2024
361c6e4
Merge branch 'main' into 3919
lihaoyi Nov 9, 2024
a8f88d4
wip
lihaoyi Nov 9, 2024
fe7aa9d
.
lihaoyi Nov 9, 2024
dc15d0e
.
lihaoyi Nov 9, 2024
eeb47b2
Merge branch 'palantir-format-empty' into 3919
lihaoyi Nov 9, 2024
af9360f
fixup
lihaoyi Nov 9, 2024
3952116
.
lihaoyi Nov 9, 2024
c4f3add
.
lihaoyi Nov 9, 2024
5eac776
Merge branch 'palantir-format-empty' into 3919
lihaoyi Nov 9, 2024
2ae4cf5
.
lihaoyi Nov 9, 2024
702e2e6
.
lihaoyi Nov 9, 2024
67d6251
.
lihaoyi Nov 9, 2024
719127f
.
lihaoyi Nov 10, 2024
2a7faf8
Merge branch 'palantir-format-empty' into 3919
lihaoyi Nov 10, 2024
693ee87
Merge branch 'main' into 3919
lihaoyi Nov 10, 2024
2fc9d85
bump mill
lihaoyi Nov 10, 2024
8e94e57
.
lihaoyi Nov 10, 2024
0859999
.
lihaoyi Nov 10, 2024
6513a46
.
lihaoyi Nov 10, 2024
a4d09b2
revert change to PalantirFormatModule#palantirFormat
lihaoyi Nov 10, 2024
5b18c90
.
lihaoyi Nov 10, 2024
5cf836b
.
lihaoyi Nov 10, 2024
a977d9d
.
lihaoyi Nov 10, 2024
03bd9fc
.
lihaoyi Nov 10, 2024
5c20fcf
.
lihaoyi Nov 10, 2024
826cc5d
.
lihaoyi Nov 10, 2024
5a417d3
.
lihaoyi Nov 10, 2024
956df25
.
lihaoyi Nov 10, 2024
b76a304
.
lihaoyi Nov 10, 2024
ae84bbc
.
lihaoyi Nov 10, 2024
52b23dd
.
lihaoyi Nov 10, 2024
25aaf12
Merge branch 'main' into 3919
lihaoyi Nov 10, 2024
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
2 changes: 1 addition & 1 deletion .config/mill-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.1
0.12.1-59-9f7450
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ jobs:
env-bridge-versions: 'essential'

# Scalafmt, Mima, and Scalafix job runs last because it's the least important:
# usually just a automated or mechanical manual fix to do before merging
# usually just an automated or mechanical manual fix to do before merging
lint-autofix:
needs: build-linux
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '11'
buildcmd: ./mill -i mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources; ./mill -i __.mimaReportBinaryIssues; ./mill -i __.fix --check
java-version: '17'
buildcmd: ./mill -i mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources && ./mill -i __.mimaReportBinaryIssues && ./mill -i __.fix --check && ./mill -i mill.javalib.palantirformat.PalantirFormatModule/ --check
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package mill.playlib.api;

public enum RouteCompilerType {
InjectedGenerator,
StaticGenerator
InjectedGenerator,
StaticGenerator
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package mill.playlib.api;

public interface RouteCompilerWorkerApi {
String compile(java.io.File[] files,
String[] additionalImports,
boolean forwardsRouter,
boolean reverseRouter,
boolean namespaceReverseRouter,
RouteCompilerType generatorType,
java.io.File dest);


String compile(
java.io.File[] files,
String[] additionalImports,
boolean forwardsRouter,
boolean reverseRouter,
boolean namespaceReverseRouter,
RouteCompilerType generatorType,
java.io.File dest);
}
10 changes: 5 additions & 5 deletions contrib/playlib/api/src/mill/playlib/api/Versions.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package mill.playlib.api;

public class Versions {
public static final String PLAY_2_6 = "2.6";
public static final String PLAY_2_7 = "2.7";
public static final String PLAY_2_8 = "2.8";
public static final String PLAY_2_9 = "2.9";
public static final String PLAY_3_0 = "3.0";
public static final String PLAY_2_6 = "2.6";
public static final String PLAY_2_7 = "2.7";
public static final String PLAY_2_8 = "2.8";
public static final String PLAY_2_9 = "2.9";
public static final String PLAY_3_0 = "3.0";
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
package mill.contrib.scoverage.api;

import java.nio.file.Path;
import java.nio.file.Files;
import java.io.IOException;
import java.io.Serializable;
import java.nio.file.Files;
import java.nio.file.Path;

public interface ScoverageReportWorkerApi2 {

interface Logger {
void info(String msg);

void error(String msg);

void debug(String msg);
}

interface Ctx {
Logger log();

Path dest();
}

public static abstract class ReportType implements Serializable {
public abstract static class ReportType implements Serializable {
private String name;

/*private[api]*/
Expand All @@ -35,15 +38,17 @@ static final class ConsoleModule extends ReportType implements Serializable {
ConsoleModule() {
super("Console");
}
};
}
;

/* private[api]*/
static final class HtmlModule extends FileReportType implements Serializable {
/* private[api]*/
HtmlModule() {
super("Html", "htmlReport");
}
};
}
;

/* private[api]*/
static final class XmlModule extends FileReportType implements Serializable {
Expand All @@ -67,7 +72,7 @@ public String toString() {
}
}

public static abstract class FileReportType extends ReportType implements Serializable {
public abstract static class FileReportType extends ReportType implements Serializable {
private final String folderName;

/*private[api]*/
Expand All @@ -91,5 +96,4 @@ static void makeAllDirs(Path path) throws IOException {
Files.createDirectories(path);
}
}

}
90 changes: 50 additions & 40 deletions contrib/testng/src/mill/testng/ResultEvent.java
Original file line number Diff line number Diff line change
@@ -1,45 +1,55 @@

package mill.testng;

import sbt.testing.*;
import org.testng.ITestResult;
import sbt.testing.*;

public class ResultEvent {
static Event failure(ITestResult result){ return event(Status.Failure, result); }
static Event skipped(ITestResult result){ return event(Status.Skipped, result); }
static Event success(ITestResult result){ return event(Status.Success, result); }

static Event event(Status result, ITestResult testNGResult) {
return new Event() {
public String fullyQualifiedName() {
return testNGResult.getTestClass().getName();
}

public Fingerprint fingerprint() {
return TestNGFingerprint.instance;
}

public Selector selector() {
return new SuiteSelector();
}

public Status status() {
return result;
}

public OptionalThrowable throwable() {
if (result != Status.Success){
return new OptionalThrowable(testNGResult.getThrowable());
}else {
return new OptionalThrowable();
}
}

@Override
public long duration() {
return testNGResult.getEndMillis() - testNGResult.getStartMillis();
}
};
}
static String classNameOf(ITestResult result){ return result.getTestClass().getName(); }
}
static Event failure(ITestResult result) {
return event(Status.Failure, result);
}

static Event skipped(ITestResult result) {
return event(Status.Skipped, result);
}

static Event success(ITestResult result) {
return event(Status.Success, result);
}

static Event event(Status result, ITestResult testNGResult) {
return new Event() {
public String fullyQualifiedName() {
return testNGResult.getTestClass().getName();
}

public Fingerprint fingerprint() {
return TestNGFingerprint.instance;
}

public Selector selector() {
return new SuiteSelector();
}

public Status status() {
return result;
}

public OptionalThrowable throwable() {
if (result != Status.Success) {
return new OptionalThrowable(testNGResult.getThrowable());
} else {
return new OptionalThrowable();
}
}

@Override
public long duration() {
return testNGResult.getEndMillis() - testNGResult.getStartMillis();
}
};
}

static String classNameOf(ITestResult result) {
return result.getTestClass().getName();
}
}
34 changes: 20 additions & 14 deletions contrib/testng/src/mill/testng/TestNGFramework.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,29 @@

public class TestNGFramework implements Framework {

public String name(){ return "TestNG"; }

public Fingerprint[] fingerprints() {
return new Fingerprint[]{TestNGFingerprint.instance};
}

@Override
public Runner runner(String[] args, String[] remoteArgs, ClassLoader classLoader) {
return new TestNGRunner(args, remoteArgs, classLoader);
}
public String name() {
return "TestNG";
}

public Fingerprint[] fingerprints() {
return new Fingerprint[] {TestNGFingerprint.instance};
}

@Override
public Runner runner(String[] args, String[] remoteArgs, ClassLoader classLoader) {
return new TestNGRunner(args, remoteArgs, classLoader);
}
}

class TestNGFingerprint implements AnnotatedFingerprint{
class TestNGFingerprint implements AnnotatedFingerprint {

public static final TestNGFingerprint instance = new TestNGFingerprint();
public static final TestNGFingerprint instance = new TestNGFingerprint();

public String annotationName(){return "org.testng.annotations.Test";}
public String annotationName() {
return "org.testng.annotations.Test";
}

public boolean isModule(){return false;}
public boolean isModule() {
return false;
}
}
Loading
Loading