From 1af0cfeb9207bae64f987b76c53fc293b256a272 Mon Sep 17 00:00:00 2001 From: svc-excavator-bot Date: Thu, 9 Jan 2020 16:07:32 +0000 Subject: [PATCH 1/2] Excavator: Upgrades Baseline to the latest version --- build.gradle | 2 +- .../javaformat/java/FormatterTest.java | 50 ++++++++++--------- .../palantir/javaformat/java/MainTest.java | 9 ++-- 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/build.gradle b/build.gradle index b83e072c1..13842d10d 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:nebula-publishing-plugin:14.1.1' classpath 'com.netflix.nebula:gradle-info-plugin:5.2.0' - classpath 'com.palantir.baseline:gradle-baseline-java:2.42.0' + classpath 'com.palantir.baseline:gradle-baseline-java:2.48.0' classpath 'gradle.plugin.org.inferred:gradle-processors:3.2.0' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.14.0' diff --git a/palantir-java-format/src/test/java/com/palantir/javaformat/java/FormatterTest.java b/palantir-java-format/src/test/java/com/palantir/javaformat/java/FormatterTest.java index 1a2284ada..893c121b7 100644 --- a/palantir-java-format/src/test/java/com/palantir/javaformat/java/FormatterTest.java +++ b/palantir-java-format/src/test/java/com/palantir/javaformat/java/FormatterTest.java @@ -330,12 +330,13 @@ public void stringEscapeLength() throws Exception { @Test public void wrapLineComment() throws Exception { - assertThat(Formatter.create().formatSource("class T {\n" - + " public static void main(String[] args) { // one long incredibly" - + " unbroken sentence moving from topic to topic so that no-one had a" - + " chance to interrupt;\n" - + " }\n" - + "}\n")) + assertThat(Formatter.create() + .formatSource("class T {\n" + + " public static void main(String[] args) { // one long incredibly" + + " unbroken sentence moving from topic to topic so that no-one had a" + + " chance to interrupt;\n" + + " }\n" + + "}\n")) .isEqualTo("class T {\n" + " public static void main(\n" + " String[]\n" @@ -348,12 +349,13 @@ public void wrapLineComment() throws Exception { @Test public void onlyWrapLineCommentOnWhitespace() throws Exception { - assertThat(Formatter.create().formatSource("class T {\n" - + " public static void main(String[] args) { // one_long_incredibly" - + "_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a" - + "_chance_to_interrupt;\n" - + " }\n" - + "}\n")) + assertThat(Formatter.create() + .formatSource("class T {\n" + + " public static void main(String[] args) { // one_long_incredibly" + + "_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a" + + "_chance_to_interrupt;\n" + + " }\n" + + "}\n")) .isEqualTo("class T {\n" + " public static void main(\n" + " String[]\n" @@ -366,12 +368,13 @@ public void onlyWrapLineCommentOnWhitespace() throws Exception { @Test public void onlyWrapLineCommentOnWhitespace_noLeadingWhitespace() throws Exception { - assertThat(Formatter.create().formatSource("class T {\n" - + " public static void main(String[] args) { //one_long_incredibly" - + "_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a" - + "_chance_to_interrupt;\n" - + " }\n" - + "}\n")) + assertThat(Formatter.create() + .formatSource("class T {\n" + + " public static void main(String[] args) { //one_long_incredibly" + + "_unbroken_sentence_moving_from_topic_to_topic_so_that_no-one_had_a" + + "_chance_to_interrupt;\n" + + " }\n" + + "}\n")) .isEqualTo("class T {\n" + " public static void main(\n" + " String[]\n" @@ -420,11 +423,12 @@ public void blankLinesImportComment() throws FormatterException { @Test public void dontWrapMoeLineComments() throws Exception { - assertThat(Formatter.create().formatSource("class T {\n" - + " // MOE: one long incredibly" - + " unbroken sentence moving from topic to topic so that no-one had a" - + " chance to interrupt;\n" - + "}\n")) + assertThat(Formatter.create() + .formatSource("class T {\n" + + " // MOE: one long incredibly" + + " unbroken sentence moving from topic to topic so that no-one had a" + + " chance to interrupt;\n" + + "}\n")) .isEqualTo("class T {\n" + " // MOE: one long incredibly" + " unbroken sentence moving from topic to topic so that no-one had a" diff --git a/palantir-java-format/src/test/java/com/palantir/javaformat/java/MainTest.java b/palantir-java-format/src/test/java/com/palantir/javaformat/java/MainTest.java index b04e8d37e..2813e1bbf 100644 --- a/palantir-java-format/src/test/java/com/palantir/javaformat/java/MainTest.java +++ b/palantir-java-format/src/test/java/com/palantir/javaformat/java/MainTest.java @@ -363,10 +363,11 @@ public void dryRunFiles() throws Exception { assertThat(exitCode).isEqualTo(0); - assertThat(out.toString()).isEqualTo(b.toAbsolutePath().toString() - + System.lineSeparator() - + c.toAbsolutePath().toString() - + System.lineSeparator()); + assertThat(out.toString()) + .isEqualTo(b.toAbsolutePath().toString() + + System.lineSeparator() + + c.toAbsolutePath().toString() + + System.lineSeparator()); assertThat(err.toString()).isEmpty(); } From 247250784cdc13d5db68f0d369227928784523f4 Mon Sep 17 00:00:00 2001 From: Dan Sanduleac Date: Thu, 9 Jan 2020 18:26:11 +0000 Subject: [PATCH 2/2] there is no more PreferAssertj --- build.gradle | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 13842d10d..fdd8bb91a 100644 --- a/build.gradle +++ b/build.gradle @@ -51,12 +51,9 @@ subprojects { } tasks.withType(JavaCompile) { - options.errorprone.errorproneArgs += [ - '-Xep:PreconditionsConstantMessage:OFF', - '-Xep:PreferSafeLoggableExceptions:OFF', - '-Xep:PreferAssertj:OFF', - '-Xep:PreferSafeLoggingPreconditions:OFF', - '-Xep:SwitchStatementDefaultCase:OFF' - ] + options.errorprone.errorproneArgs += ['-Xep:PreconditionsConstantMessage:OFF', + '-Xep:PreferSafeLoggableExceptions:OFF', + '-Xep:PreferSafeLoggingPreconditions:OFF', + '-Xep:SwitchStatementDefaultCase:OFF'] } }