Skip to content

Commit 8531a92

Browse files
Excavator: Upgrades Baseline to the latest version
1 parent 3b67bcb commit 8531a92

File tree

7 files changed

+43
-50
lines changed

7 files changed

+43
-50
lines changed

.baseline/checkstyle/checkstyle.xml

Lines changed: 23 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
<?xml version="1.0"?>
2-
<!DOCTYPE module PUBLIC
3-
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4-
"https://checkstyle.org/dtds/configuration_1_3.dtd">
5-
6-
<!--
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
72
Palantir Baseline Checkstyle configuration.
83
Authors: Robert Fink, Brian Worth, Merrick Zoubeiri, and many other contributors. Based in part on http://checkstyle.sourceforge.net/google_style.html
94
Please keep checks alphabetized with one exception: "relaxed" checks are grouped together at the bottom for easier disabling.
105
Check-specific comments reference documents internal to Palantir and can be safely ignored or removed.
11-
-->
12-
6+
--><!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
137
<module name="Checker">
148
<property name="charset" value="UTF-8"/>
159
<property name="severity" value="error"/>
@@ -47,6 +41,10 @@
4741
<module name="BeforeExecutionExclusionFileFilter">
4842
<property name="fileNamePattern" value="module\-info\.java$"/>
4943
</module>
44+
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
45+
<property name="max" value="120"/>
46+
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
47+
</module>
5048
<module name="TreeWalker">
5149
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
5250
<module name="SuppressionCommentFilter">
@@ -65,7 +63,9 @@
6563
<property name="tokens" value="VARIABLE_DEF"/>
6664
<property name="allowSamelineMultipleAnnotations" value="true"/>
6765
</module>
68-
<module name="AnnotationUseStyle"/> <!-- Java Style Guide: Annotations -->
66+
<module name="AnnotationUseStyle"> <!-- Java Style Guide: Annotations -->
67+
<property name="trailingArrayComma" value="ignore"/>
68+
</module>
6969
<module name="ArrayTypeStyle"/> <!-- Java Style Guide: No C-style array declarations -->
7070
<module name="AvoidEscapedUnicodeCharacters"> <!-- Java Style Guide: Non-ASCII characters -->
7171
<property name="allowEscapesForControlCharacters" value="true"/>
@@ -77,14 +77,7 @@
7777
</module>
7878
<module name="AvoidStarImport"/> <!-- Java Style Guide: No wildcard imports -->
7979
<module name="AvoidStaticImport"> <!-- Java Style Guide: No static imports -->
80-
<property name="excludes" value="
81-
com.google.common.base.Preconditions.*,
82-
com.palantir.logsafe.Preconditions.*,
83-
java.util.Collections.*,
84-
java.util.stream.Collectors.*,
85-
org.apache.commons.lang3.Validate.*,
86-
org.assertj.core.api.Assertions.*,
87-
org.mockito.Mockito.*"/>
80+
<property name="excludes" value="com.google.common.base.Preconditions.*, com.palantir.logsafe.Preconditions.*, java.util.Collections.*, java.util.stream.Collectors.*, org.apache.commons.lang3.Validate.*, org.assertj.core.api.Assertions.*, org.mockito.Mockito.*"/>
8881
</module>
8982
<module name="ClassTypeParameterName"> <!-- Java Style Guide: Type variable names -->
9083
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
@@ -134,12 +127,12 @@
134127
<module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package -->
135128
<property name="id" value="BanShadedClasses"/>
136129
<property name="illegalPkgs" value=".*\.(repackaged|shaded|thirdparty)"/>
137-
<property name="regexp" value="true" />
130+
<property name="regexp" value="true"/>
138131
<message key="import.illegal" value="Must not import repackaged classes."/>
139132
</module>
140133
<module name="IllegalImport">
141134
<property name="illegalPkgs" value="^org\.gradle\.(internal|.*\.internal)"/>
142-
<property name="regexp" value="true" />
135+
<property name="regexp" value="true"/>
143136
<message key="import.illegal" value="Do not rely on gradle internal classes as these may change in minor releases - use org.gradle.api versions instead."/>
144137
</module>
145138
<module name="IllegalImport">
@@ -192,11 +185,9 @@
192185
<property name="separated" value="true"/>
193186
<property name="sortStaticImportsAlphabetically" value="true"/>
194187
</module>
188+
195189
<module name="InnerAssignment"/> <!-- Java Coding Guidelines: Inner assignments: Not used -->
196-
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
197-
<property name="max" value="120"/>
198-
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
199-
</module>
190+
<!-- Java Style Guide: Nonempty blocks: K & R style -->
200191
<module name="MemberName"> <!-- Java Style Guide: Non-constant field names -->
201192
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
202193
<message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
@@ -237,6 +228,7 @@
237228
<message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
238229
</module>
239230
<module name="ParameterAssignment"/> <!-- Java Coding Guidelines: Final variables and parameters -->
231+
<!-- Java Style Guide: Horizontal whitespace -->
240232
<module name="RedundantImport"/> <!-- Java Style Guide: No unused imports -->
241233
<module name="RedundantModifier"/> <!-- Java Coding Guidelines: Avoid redundant modifiers -->
242234
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
@@ -352,7 +344,7 @@
352344
</module>
353345
<module name="RegexpSinglelineJava">
354346
<property name="format" value="\bCharset.defaultCharset\("/>
355-
<property name="message" value="Use explicit charset (e.g. StandardCharsets.UTF-8) instead of default."/>
347+
<property name="message" value="Use explicit charset (e.g. StandardCharsets.UTF_8) instead of default."/>
356348
</module>
357349
<module name="RegexpSinglelineJava">
358350
<property name="format" value="\bIOUtils\.toString\("/>
@@ -361,18 +353,19 @@
361353
<module name="RegexpSinglelineJava">
362354
<property name="format" value="\/\/TODO|\/\/ TODO(?!\([^()\s]+\): )"/>
363355
<property name="message" value="TODO format: // TODO(#issue): explanation"/>
356+
<property name="ignoreCase" value="true"/>
364357
</module>
365358
<module name="RegexpSinglelineJava">
366359
<property name="format" value="(void setUp\(\))|(void setup\(\))|(void setupStatic\(\))|(void setUpStatic\(\))|(void beforeTest\(\))|(void teardown\(\))|(void tearDown\(\))|(void beforeStatic\(\))|(void afterStatic\(\))"/>
367360
<property name="message" value="Test setup/teardown methods are called before(), beforeClass(), after(), afterClass(), but not setUp, teardown, etc."/>
368361
</module>
369362
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
370363
<property name="option" value="same"/>
371-
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
364+
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
372365
</module>
373366
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
374367
<property name="option" value="alone"/>
375-
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
368+
<property name="tokens" value="LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
376369
</module>
377370
<module name="SeparatorWrap"> <!-- Java Style Guide: Where to break -->
378371
<property name="tokens" value="DOT"/>
@@ -390,7 +383,7 @@
390383
<module name="SuppressWarnings">
391384
<property name="format" value="serial"/>
392385
</module>
393-
<module name="SuppressWarningsHolder" /> <!-- Required for SuppressWarningsFilter -->
386+
<module name="SuppressWarningsHolder"/> <!-- Required for SuppressWarningsFilter -->
394387
<module name="TypeName"> <!-- Java Style Guide: Class names -->
395388
<message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
396389
</module>
@@ -401,16 +394,7 @@
401394
<module name="UpperEll"/> <!-- Java Style Guide: Numeric Literals -->
402395
<module name="VisibilityModifier"/> <!-- Java Coding Guidelines: Minimize mutability -->
403396
<module name="WhitespaceAfter"/> <!-- Java Style Guide: Horizontal whitespace -->
404-
<module name="WhitespaceAround"> <!-- Java Style Guide: Horizontal whitespace -->
405-
<property name="allowEmptyConstructors" value="true"/>
406-
<property name="allowEmptyMethods" value="true"/>
407-
<property name="allowEmptyTypes" value="true"/>
408-
<property name="allowEmptyLoops" value="true"/>
409-
<property name="allowEmptyLambdas" value="true"/>
410-
<property name="ignoreEnhancedForColon" value="false"/>
411-
<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)"/>
412-
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
413-
</module>
397+
414398

415399
<!-- Stricter checks begin: delete some or all of the following for faster prototyping, but please restore before pushing to production. -->
416400

@@ -423,13 +407,10 @@
423407
<property name="ignoredAnnotations" value="ParameterizedTest, Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/>
424408
</module>
425409
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
426-
<property name="scope" value="public"/>
410+
<property name="accessModifiers" value="public"/>
427411
<property name="allowMissingParamTags" value="true"/>
428-
<property name="allowMissingThrowsTags" value="true"/>
429412
<property name="allowMissingReturnTag" value="true"/>
430-
<property name="minLineCount" value="99999999"/>
431413
<property name="allowedAnnotations" value="Override, Test"/>
432-
<property name="allowThrowsTagsForSubclasses" value="true"/>
433414
</module>
434415
<module name="JavadocStyle"/> <!-- Java Style Guide: Javadoc -->
435416
<module name="JavadocTagContinuationIndentation"> <!-- Java Style Guide: At-clauses -->
@@ -462,4 +443,4 @@
462443

463444
<!-- Stricter checks end -->
464445
</module>
465-
</module>
446+
</module>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@
4444
<package name="" withSubpackages="true" static="false" />
4545
</value>
4646
</option>
47+
<DO_NOT_IMPORT_INNER>
48+
<CLASS name="Builder" />
49+
<CLASS name="Callback" />
50+
<CLASS name="Class" />
51+
<CLASS name="Entry" />
52+
<CLASS name="Enum" />
53+
<CLASS name="Factory" />
54+
<CLASS name="Type" />
55+
<CLASS name="Key" />
56+
<CLASS name="Id" />
57+
<CLASS name="Provider" />
58+
</DO_NOT_IMPORT_INNER>
4759
</GroovyCodeStyleSettings>
4860
<option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
4961
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ buildscript {
2525
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.4.0'
2626
classpath 'com.palantir.javaformat:gradle-palantir-java-format:1.0.1'
2727
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.17.2'
28-
classpath 'com.palantir.baseline:gradle-baseline-java:3.14.1'
28+
classpath 'com.palantir.baseline:gradle-baseline-java:4.65.0'
2929
classpath 'com.palantir.gradle.conjure:gradle-conjure:4.18.0'
3030
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2'
3131
classpath 'gradle.plugin.org.inferred:gradle-processors:3.6.0'

conjure-python-core/src/main/java/com/palantir/conjure/python/ConjurePythonGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private PythonFile getImplPythonFile(
160160

161161
PythonPackage rootPackage = PythonPackage.of(implPackageNameProcessor.process(""));
162162
List<PythonFile> pythonFiles = KeyedStream.stream(snippetsByPackage)
163-
.map((pythonPackage, pythonSnippets) -> PythonFile.builder()
163+
.map((_pythonPackage, pythonSnippets) -> PythonFile.builder()
164164
.pythonPackage(rootPackage)
165165
.fileName(IMPL_PY)
166166
.contents(pythonSnippets)
@@ -239,7 +239,7 @@ private PythonFile getRootInit(Set<PythonPackage> packageNames, PythonPackage ro
239239
.text(String.format("__conjure_generator_version__ = \"%s\"", config.generatorVersion()))
240240
.build());
241241
config.packageVersion()
242-
.ifPresent(version -> builder.addContents(PythonLine.builder()
242+
.ifPresent(_version -> builder.addContents(PythonLine.builder()
243243
.pythonPackage(rootPackage)
244244
.text(String.format(
245245
"__version__ = \"%s\"", config.packageVersion().get()))

conjure-python-core/src/main/java/com/palantir/conjure/python/PythonAliasTopologicalSorter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static List<AliasSnippet> getSortedSnippets(List<AliasSnippet> snippets)
5757
.collect(Collectors.toSet());
5858
Map<AliasSnippet, Integer> nonRootsToInDegree = mutableGraph.nodes().stream()
5959
.filter(node -> mutableGraph.inDegree(node) > 0)
60-
.collect(Collectors.toMap(node -> node, mutableGraph::inDegree, (a, b) -> a));
60+
.collect(Collectors.toMap(node -> node, mutableGraph::inDegree, (a, _b) -> a));
6161

6262
// Kahn's Algorithm https://en.wikipedia.org/wiki/Topological_sorting#Kahn's_algorithm
6363
while (!roots.isEmpty()) {

conjure-python-core/src/main/java/com/palantir/conjure/python/client/ClientGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private PythonEndpointDefinition generateEndpoint(
104104
.myPyType(argEntry.getType().accept(myPyTypeNameVisitor))
105105
.isOptional(dealiasingTypeVisitor
106106
.dealias(argEntry.getType())
107-
.fold(typeDefinition -> false, type -> type.accept(TypeVisitor.IS_OPTIONAL)))
107+
.fold(_typeDefinition -> false, type -> type.accept(TypeVisitor.IS_OPTIONAL)))
108108
.build())
109109
.collect(Collectors.toList());
110110

@@ -128,7 +128,7 @@ private PythonEndpointDefinition generateEndpoint(
128128
.getReturns()
129129
.map(rt -> dealiasingTypeVisitor
130130
.dealias(rt)
131-
.fold(typeDefinition -> false, type -> type.accept(TypeVisitor.IS_OPTIONAL)))
131+
.fold(_typeDefinition -> false, type -> type.accept(TypeVisitor.IS_OPTIONAL)))
132132
.orElse(false))
133133
.build();
134134
}

conjure-python-core/src/main/java/com/palantir/conjure/python/types/PythonTypeGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private BeanSnippet generateBean(ObjectDefinition typeDef) {
112112
.myPyType(entry.getType().accept(myPyTypeNameVisitor))
113113
.isOptional(dealiasingTypeVisitor
114114
.dealias(entry.getType())
115-
.fold(typeDefinition -> false, type -> type.accept(TypeVisitor.IS_OPTIONAL)))
115+
.fold(_typeDefinition -> false, type -> type.accept(TypeVisitor.IS_OPTIONAL)))
116116
.build())
117117
.collect(Collectors.toList());
118118

@@ -166,7 +166,7 @@ private UnionSnippet generateUnion(UnionDefinition typeDef) {
166166
.pythonType(conjureType.accept(pythonTypeNameVisitor))
167167
.isOptional(dealiasingTypeVisitor
168168
.dealias(unionMember.getType())
169-
.fold(typeDefinition -> false, type -> type.accept(TypeVisitor.IS_OPTIONAL)))
169+
.fold(_typeDefinition -> false, type -> type.accept(TypeVisitor.IS_OPTIONAL)))
170170
.build();
171171
})
172172
.collect(Collectors.toList());

0 commit comments

Comments
 (0)