Skip to content

Commit e21e13a

Browse files
Excavator: Upgrades Baseline to the latest version (palantir#278)
* Excavator: Upgrades Baseline to the latest version * Fix errorprone errors Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com> Co-authored-by: fwindheuser <fwindheuser@palantir.com>
1 parent 659dacb commit e21e13a

7 files changed

Lines changed: 15 additions & 19 deletions

File tree

‎.baseline/checkstyle/checkstyle.xml‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
<module name="BeforeExecutionExclusionFileFilter">
4848
<property name="fileNamePattern" value="module\-info\.java$"/>
4949
</module>
50+
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
51+
<property name="max" value="120"/>
52+
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
53+
</module>
5054
<module name="TreeWalker">
5155
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
5256
<module name="SuppressionCommentFilter">
@@ -193,10 +197,6 @@
193197
<property name="sortStaticImportsAlphabetically" value="true"/>
194198
</module>
195199
<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>
200200
<module name="MemberName"> <!-- Java Style Guide: Non-constant field names -->
201201
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
202202
<message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
@@ -361,18 +361,19 @@
361361
<module name="RegexpSinglelineJava">
362362
<property name="format" value="\/\/TODO|\/\/ TODO(?!\([^()\s]+\): )"/>
363363
<property name="message" value="TODO format: // TODO(#issue): explanation"/>
364+
<property name="ignoreCase" value="true"/>
364365
</module>
365366
<module name="RegexpSinglelineJava">
366367
<property name="format" value="(void setUp\(\))|(void setup\(\))|(void setupStatic\(\))|(void setUpStatic\(\))|(void beforeTest\(\))|(void teardown\(\))|(void tearDown\(\))|(void beforeStatic\(\))|(void afterStatic\(\))"/>
367368
<property name="message" value="Test setup/teardown methods are called before(), beforeClass(), after(), afterClass(), but not setUp, teardown, etc."/>
368369
</module>
369370
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
370371
<property name="option" value="same"/>
371-
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
372+
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
372373
</module>
373374
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
374375
<property name="option" value="alone"/>
375-
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
376+
<property name="tokens" value="LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
376377
</module>
377378
<module name="SeparatorWrap"> <!-- Java Style Guide: Where to break -->
378379
<property name="tokens" value="DOT"/>
@@ -425,11 +426,8 @@
425426
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
426427
<property name="scope" value="public"/>
427428
<property name="allowMissingParamTags" value="true"/>
428-
<property name="allowMissingThrowsTags" value="true"/>
429429
<property name="allowMissingReturnTag" value="true"/>
430-
<property name="minLineCount" value="99999999"/>
431430
<property name="allowedAnnotations" value="Override, Test"/>
432-
<property name="allowThrowsTagsForSubclasses" value="true"/>
433431
</module>
434432
<module name="JavadocStyle"/> <!-- Java Style Guide: Javadoc -->
435433
<module name="JavadocTagContinuationIndentation"> <!-- Java Style Guide: At-clauses -->

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<package name="" static="false" withSubpackages="true" />
3131
</value>
3232
</option>
33+
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
3334
<GroovyCodeStyleSettings>
3435
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
3536
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />

‎build.gradle‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ buildscript {
1111
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
1212
classpath 'com.netflix.nebula:nebula-publishing-plugin:17.3.2'
1313
classpath 'com.netflix.nebula:gradle-info-plugin:9.1.1'
14-
classpath 'com.palantir.baseline:gradle-baseline-java:3.11.0'
14+
classpath 'com.palantir.baseline:gradle-baseline-java:3.50.0'
1515
classpath 'gradle.plugin.org.inferred:gradle-processors:3.3.0'
1616
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.3'
1717
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.27.0'
@@ -53,10 +53,7 @@ subprojects {
5353
}
5454

5555
tasks.withType(JavaCompile) {
56-
options.errorprone.errorproneArgs += ['-Xep:PreconditionsConstantMessage:OFF',
57-
'-Xep:PreferSafeLoggableExceptions:OFF',
58-
'-Xep:PreferSafeLoggingPreconditions:OFF',
59-
'-Xep:SwitchStatementDefaultCase:OFF']
56+
options.errorprone.disable 'PreconditionsConstantMessage', 'PreferSafeLoggableExceptions', 'PreferSafeLoggingPreconditions'
6057
}
6158

6259
// Run `./gradlew test -Drecreate=true` to recreate all the expected

‎gradle-palantir-java-format/src/main/java/com/palantir/javaformat/gradle/PalantirJavaFormatSpotlessPlugin.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public class PalantirJavaFormatSpotlessPlugin implements Plugin<Project> {
2828
public void apply(Project project) {
2929
project.getRootProject().getPluginManager().apply(PalantirJavaFormatProviderPlugin.class);
3030

31-
project.getPluginManager().withPlugin("java", plugin -> {
31+
project.getPluginManager().withPlugin("java", _javaPlugin -> {
3232
SPOTLESS_PLUGINS.forEach(
33-
spotlessPluginId -> project.getPluginManager().withPlugin(spotlessPluginId, spotlessPlugin -> {
33+
spotlessPluginId -> project.getPluginManager().withPlugin(spotlessPluginId, _spotlessPlugin -> {
3434
SpotlessInterop.addSpotlessJavaStep(
3535
project, PalantirJavaFormatProviderPlugin.CONFIGURATION_NAME);
3636
}));

‎idea-plugin/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ dependencies {
5858
}
5959

6060
tasks.withType(JavaCompile).configureEach {
61-
options.errorprone.errorproneArgs += ['-Xep:StrictUnusedVariable:OFF']
61+
options.errorprone.disable 'StrictUnusedVariable'
6262
}
6363

6464
check.dependsOn buildPlugin, verifyPlugin

‎palantir-java-format/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies {
3131
}
3232

3333
tasks.withType(JavaCompile).configureEach {
34-
options.errorprone.errorproneArgs += ['-Xep:StrictUnusedVariable:OFF']
34+
options.errorprone.disable 'StrictUnusedVariable'
3535
}
3636

3737
// false positives due to org.junit.runners.* in the test cases

‎palantir-java-format/src/main/java/com/palantir/javaformat/FormattingError.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.palantir.javaformat.java.FormatterDiagnostic;
2020

2121
/** An unchecked formatting error. */
22-
public class FormattingError extends Error {
22+
public class FormattingError extends RuntimeException {
2323

2424
private final ImmutableList<FormatterDiagnostic> diagnostics;
2525

0 commit comments

Comments
 (0)