Skip to content

Commit 2fc2dd1

Browse files
Excavator: Upgrades Baseline to the latest version
1 parent 38027d7 commit 2fc2dd1

File tree

10 files changed

+67
-30
lines changed

10 files changed

+67
-30
lines changed

.baseline/checkstyle/checkstyle-suppressions.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0"?>
2-
32
<!DOCTYPE suppressions PUBLIC
4-
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
5-
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
3+
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
4+
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
65

76
<!-- IMPORTANT ECLIPSE NOTE: If you change this file, you must restart Eclipse
87
for your changes to take effect in its Checkstyle integration. -->
@@ -12,6 +11,11 @@
1211
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="VariableDeclarationUsageDistance" />
1312
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="VisibilityModifier" />
1413
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="AvoidStaticImport" />
14+
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" id="BanSystemOut" />
15+
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" id="BanSystemErr" />
16+
17+
<!-- Suppress test resources -->
18+
<suppress files="[/\\]src[/\\]test[/\\]resources.*" checks="." />
1519

1620
<!-- JavadocStyle enforces existence of package-info.java package-level Javadoc; we consider this a bug. -->
1721
<suppress files="package-info.java" checks="JavadocStyle" />

.baseline/checkstyle/checkstyle.xml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<!DOCTYPE module PUBLIC
3-
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4-
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
3+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
55

66
<!--
77
Palantir Baseline Checkstyle configuration.
@@ -40,13 +40,18 @@
4040
<property name="message" value="Whitespace at end-of-line"/>
4141
</module>
4242
<module name="RegexpMultiline"> <!-- Java Style Guide: Vertical Whitespace -->
43-
<property name="fileExtensions" value="java"/>
43+
<property name="fileExtensions" value="java"/>
4444
<property name="format" value="^\n\n$"/>
4545
<property name="message" value="Two consecutive blank lines are not permitted."/>
4646
</module>
4747
<module name="SuppressionFilter"> <!-- baseline-gradle: README.md -->
4848
<property name="file" value="${config_loc}/checkstyle-suppressions.xml"/>
4949
</module>
50+
<module name="SuppressionFilter"> <!-- baseline-gradle: README.md -->
51+
<!-- custom-suppressions.xml allows users to specify suppresions that will not be overriden by baselineUpdateConfig -->
52+
<property name="file" value="${config_loc}/custom-suppressions.xml"/>
53+
<property name="optional" value="true"/>
54+
</module>
5055
<module name="SuppressWarningsFilter"/> <!-- baseline-gradle: README.md -->
5156
<module name="TreeWalker">
5257
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
@@ -79,11 +84,13 @@
7984
<module name="AvoidStarImport"/> <!-- Java Style Guide: No wildcard imports -->
8085
<module name="AvoidStaticImport"> <!-- Java Style Guide: No static imports -->
8186
<property name="excludes" value="
87+
com.google.common.base.Preconditions.*,
88+
com.palantir.logsafe.Preconditions.*,
8289
java.util.Collections.*,
8390
java.util.stream.Collectors.*,
84-
com.palantir.logsafe.Preconditions.*,
85-
com.google.common.base.Preconditions.*,
86-
org.apache.commons.lang3.Validate.*"/>
91+
org.apache.commons.lang3.Validate.*,
92+
org.assertj.core.api.Assertions.*,
93+
org.mockito.Mockito.*"/>
8794
</module>
8895
<module name="ClassTypeParameterName"> <!-- Java Style Guide: Type variable names -->
8996
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
@@ -122,11 +129,17 @@
122129
<property name="illegalPkgs" value="junit.framework"/>
123130
<message key="import.illegal" value="Use JUnit 4-style (org.junit.*) test classes and assertions instead of JUnit 3 (junit.framework.*)."/>
124131
</module>
132+
<module name="IllegalImport"> <!-- Only relevant for pre-Java 11 because javafx is gone completely in Java 11 -->
133+
<property name="id" value="BanJavafx"/>
134+
<property name="illegalPkgs" value="javafx"/>
135+
<message key="import.illegal" value="Must not import javafx classes because some OpenJDK builds do not include javafx."/>
136+
</module>
125137
<module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package -->
126138
<property name="illegalPkgs" value="org.elasticsearch.common.base, com.clearspring.analytics.util, org.spark_project.guava"/>
127139
<message key="import.illegal" value="Must not import repackaged classes."/>
128140
</module>
129141
<module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package -->
142+
<property name="id" value="BanShadedClasses"/>
130143
<property name="illegalPkgs" value=".*\.(repackaged|shaded|thirdparty)"/>
131144
<property name="regexp" value="true" />
132145
<message key="import.illegal" value="Must not import repackaged classes."/>
@@ -334,6 +347,18 @@
334347
<property name="message" value="printStackTrace is not generally allowed."/>
335348
<property name="ignoreComments" value="true"/>
336349
</module>
350+
<module name="RegexpSinglelineJava">
351+
<property name="id" value="BanSystemOut"/>
352+
<property name="format" value="System\.out\."/>
353+
<property name="message" value="Logging with System.out is not allowed because it has no metadata and can't be configured at runtime. Please use an SLF4J logger instead, e.g. log.info(&quot;Message&quot;)."/>
354+
<property name="ignoreComments" value="true"/>
355+
</module>
356+
<module name="RegexpSinglelineJava">
357+
<property name="id" value="BanSystemErr"/>
358+
<property name="format" value="System\.err\."/>
359+
<property name="message" value="Logging with System.err is not allowed because it has no metadata and can't be configured at runtime. Please use an SLF4J logger instead, e.g. log.info(&quot;Message&quot;)."/>
360+
<property name="ignoreComments" value="true"/>
361+
</module>
337362
<module name="RegexpSinglelineJava">
338363
<property name="format" value="\bCharsets\."/>
339364
<property name="message" value="Use JDK StandardCharsets instead of alternatives."/>
@@ -399,6 +424,7 @@
399424
<property name="allowEmptyMethods" value="true"/>
400425
<property name="allowEmptyTypes" value="true"/>
401426
<property name="allowEmptyLoops" value="true"/>
427+
<property name="allowEmptyLambdas" value="true"/>
402428
<property name="ignoreEnhancedForColon" value="false"/>
403429
<message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
404430
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
@@ -412,7 +438,7 @@
412438
</module>
413439
<module name="CyclomaticComplexity"/> <!-- Java Coding Guidelines: Reduce Cyclomatic Complexity -->
414440
<module name="DesignForExtension"> <!-- Java Coding Guidelines: Design for extension -->
415-
<property name="ignoredAnnotations" value="Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/>
441+
<property name="ignoredAnnotations" value="ParameterizedTest, Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/>
416442
</module>
417443
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
418444
<property name="scope" value="public"/>
@@ -445,7 +471,7 @@
445471
<module name="NestedTryDepth"/> <!-- Java Coding Guide: Try/catch blocks: never nested -->
446472
<module name="NonEmptyAtclauseDescription"/> <!-- Java Style Guide: At-clauses -->
447473
<module name="ParameterName"> <!-- Java Style Guide: Parameter names -->
448-
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
474+
<property name="format" value="^_?[a-z][a-zA-Z0-9]+$"/>
449475
<message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/>
450476
</module>
451477
<module name="SingleLineJavadoc"/> <!-- Java Style Guide: General form -->

.baseline/idea/intellij-java-palantir-style.xml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<option name="JD_KEEP_EMPTY_EXCEPTION" value="false" />
5151
<option name="JD_KEEP_EMPTY_PARAMETER" value="false" />
5252
<option name="JD_KEEP_EMPTY_RETURN" value="false" />
53+
<option name="JD_PRESERVE_LINE_FEEDS" value="true" />
5354
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
5455
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
5556
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
@@ -85,34 +86,44 @@
8586
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
8687
<option name="ALIGN_MULTILINE_RESOURCES" value="false" />
8788
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
89+
<option name="ASSIGNMENT_WRAP" value="1" />
8890
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
8991
<option name="BINARY_OPERATION_WRAP" value="1" />
9092
<option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
91-
<option name="CALL_PARAMETERS_WRAP" value="1" />
93+
<option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
94+
<option name="CALL_PARAMETERS_WRAP" value="5" />
9295
<option name="DOWHILE_BRACE_FORCE" value="3" />
96+
<option name="ENUM_CONSTANTS_WRAP" value="2" />
9397
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
9498
<option name="EXTENDS_LIST_WRAP" value="1" />
9599
<option name="FIELD_ANNOTATION_WRAP" value="1" />
96100
<option name="FOR_BRACE_FORCE" value="3" />
97101
<option name="FOR_STATEMENT_WRAP" value="1" />
98102
<option name="IF_BRACE_FORCE" value="3" />
99-
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
103+
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
104+
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
105+
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
100106
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
101107
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
102108
<option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
109+
<option name="KEEP_SIMPLE_LAMBDAS_IN_ONE_LINE" value="true" />
103110
<option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
104111
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
105112
<option name="LINE_COMMENT_ADD_SPACE" value="true" />
106-
<option name="METHOD_PARAMETERS_WRAP" value="1" />
113+
<option name="METHOD_CALL_CHAIN_WRAP" value="5" />
114+
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
115+
<option name="METHOD_PARAMETERS_WRAP" value="5" />
107116
<option name="OPTIMIZE_IMPORTS_ON_THE_FLY" value="true" />
108117
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
109118
<option name="RESOURCE_LIST_WRAP" value="5" />
119+
<option name="RIGHT_MARGIN" value="120" />
110120
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
111121
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
112-
<option name="TERNARY_OPERATION_WRAP" value="1" />
122+
<option name="TERNARY_OPERATION_WRAP" value="5" />
113123
<option name="THROWS_KEYWORD_WRAP" value="1" />
114124
<option name="THROWS_LIST_WRAP" value="1" />
115125
<option name="WHILE_BRACE_FORCE" value="3" />
126+
<option name="WRAP_ON_TYPING" value="1" />
116127
<arrangement>
117128
<rules>
118129
<section>

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ buildscript {
2929
classpath 'com.netflix.nebula:gradle-info-plugin:5.1.0'
3030
classpath 'com.netflix.nebula:nebula-publishing-plugin:13.6.1'
3131
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
32-
classpath 'com.palantir.baseline:gradle-baseline-java:0.37.4'
32+
classpath 'com.palantir.baseline:gradle-baseline-java:2.17.0'
3333
classpath 'com.palantir.gradle.conjure:gradle-conjure:4.13.1'
3434
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2'
3535
}

test-cases-internal/src/main/java/com/palantir/conjure/verification/EndpointNameConjureTypeVisitor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
public final class EndpointNameConjureTypeVisitor implements ConjureTypeVisitor<String> {
3737
@Override
38-
public String visitAny(AnyType type) {
38+
public String visitAny(AnyType _type) {
3939
return "any";
4040
}
4141

@@ -77,12 +77,12 @@ public String visitSet(SetType type) {
7777
}
7878

7979
@Override
80-
public String visitBinary(BinaryType type) {
80+
public String visitBinary(BinaryType _type) {
8181
return "binary";
8282
}
8383

8484
@Override
85-
public String visitDateTime(DateTimeType type) {
85+
public String visitDateTime(DateTimeType _type) {
8686
return "datetime";
8787
}
8888
}

test-cases-internal/src/main/java/com/palantir/conjure/verification/GenerateClientServices.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
package com.palantir.conjure.verification;
66

7-
import com.google.common.base.Preconditions;
87
import com.google.common.collect.ImmutableMap;
98
import com.google.common.io.MoreFiles;
109
import com.google.common.io.RecursiveDeleteOption;
@@ -19,7 +18,7 @@ public final class GenerateClientServices {
1918
private GenerateClientServices() {}
2019

2120
public static void main(String... args) throws IOException {
22-
Preconditions.checkArgument(args.length == 2, "Usage: <master-test-cases.yml> <gitignored output dir>");
21+
com.palantir.logsafe.Preconditions.checkArgument(args.length == 2, "Usage: <master-test-cases.yml> <gitignored output dir>");
2322
File file = new File(args[0]);
2423
File outputDir = new File(args[1]);
2524

test-cases-internal/src/main/java/com/palantir/conjure/verification/GenerateServerServices.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
package com.palantir.conjure.verification;
66

7-
import com.google.common.base.Preconditions;
87
import com.google.common.collect.ImmutableMap;
98
import com.google.common.io.MoreFiles;
109
import com.google.common.io.RecursiveDeleteOption;
@@ -19,7 +18,7 @@ public final class GenerateServerServices {
1918
private GenerateServerServices() {}
2019

2120
public static void main(String... args) throws IOException {
22-
Preconditions.checkArgument(args.length == 2, "Usage: <master-test-cases.yml> <gitignored output dir>");
21+
com.palantir.logsafe.Preconditions.checkArgument(args.length == 2, "Usage: <master-test-cases.yml> <gitignored output dir>");
2322
File file = new File(args[0]);
2423
File outputDir = new File(args[1]);
2524

test-cases-internal/src/main/java/com/palantir/conjure/verification/ResolveLocalReferencesConjureTypeVisitor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
public final class ResolveLocalReferencesConjureTypeVisitor implements ConjureTypeVisitor<String> {
3535
@Override
36-
public String visitAny(AnyType type) {
36+
public String visitAny(AnyType _type) {
3737
return "any";
3838
}
3939

@@ -75,12 +75,12 @@ public String visitSet(SetType type) {
7575
}
7676

7777
@Override
78-
public String visitBinary(BinaryType type) {
78+
public String visitBinary(BinaryType _type) {
7979
return "binary";
8080
}
8181

8282
@Override
83-
public String visitDateTime(DateTimeType type) {
83+
public String visitDateTime(DateTimeType _type) {
8484
return "datetime";
8585
}
8686
}

verification-client-api/src/main/java/com/palantir/conjure/verification/client/CompileVerificationClientTestCasesJson.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import static java.util.stream.Collectors.toSet;
2020

2121
import com.fasterxml.jackson.databind.ObjectMapper;
22-
import com.google.common.base.Preconditions;
2322
import com.google.common.collect.ImmutableMap;
2423
import com.google.common.collect.Sets;
2524
import com.google.common.collect.Streams;
@@ -49,7 +48,7 @@ private CompileVerificationClientTestCasesJson() {}
4948

5049
public static void main(String... args) throws IOException {
5150

52-
Preconditions.checkArgument(args.length == 2, "Usage: <master-test-cases.yml> <client-test-cases.json>");
51+
com.palantir.logsafe.Preconditions.checkArgument(args.length == 2, "Usage: <master-test-cases.yml> <client-test-cases.json>");
5352
File file = new File(args[0]);
5453
File outputFile = new File(args[1]);
5554

verification-server-api/src/main/java/com/palantir/conjure/verification/server/CompileVerificationServerTestCasesJson.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import static java.util.stream.Collectors.toSet;
88

99
import com.fasterxml.jackson.databind.ObjectMapper;
10-
import com.google.common.base.Preconditions;
1110
import com.google.common.collect.ImmutableMap;
1211
import com.google.common.collect.Sets;
1312
import com.google.common.collect.Streams;
@@ -40,7 +39,7 @@ private CompileVerificationServerTestCasesJson() {}
4039

4140
public static void main(String... args) throws IOException {
4241

43-
Preconditions.checkArgument(args.length == 2, "Usage: <master-test-cases.yml> <server-test-cases.json>");
42+
com.palantir.logsafe.Preconditions.checkArgument(args.length == 2, "Usage: <master-test-cases.yml> <server-test-cases.json>");
4443
File file = new File(args[0]);
4544
File outputFile = new File(args[1]);
4645

0 commit comments

Comments
 (0)