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

Excavator: Upgrades Baseline to the latest version #278

Merged
merged 2 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 7 additions & 9 deletions .baseline/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="TreeWalker">
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
<module name="SuppressionCommentFilter">
Expand Down Expand Up @@ -193,10 +197,6 @@
<property name="sortStaticImportsAlphabetically" value="true"/>
</module>
<module name="InnerAssignment"/> <!-- Java Coding Guidelines: Inner assignments: Not used -->
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="MemberName"> <!-- Java Style Guide: Non-constant field names -->
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
<message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
Expand Down Expand Up @@ -361,18 +361,19 @@
<module name="RegexpSinglelineJava">
<property name="format" value="\/\/TODO|\/\/ TODO(?!\([^()\s]+\): )"/>
<property name="message" value="TODO format: // TODO(#issue): explanation"/>
<property name="ignoreCase" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="(void setUp\(\))|(void setup\(\))|(void setupStatic\(\))|(void setUpStatic\(\))|(void beforeTest\(\))|(void teardown\(\))|(void tearDown\(\))|(void beforeStatic\(\))|(void afterStatic\(\))"/>
<property name="message" value="Test setup/teardown methods are called before(), beforeClass(), after(), afterClass(), but not setUp, teardown, etc."/>
</module>
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
<property name="option" value="same"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
</module>
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
<property name="option" value="alone"/>
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
<property name="tokens" value="LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
</module>
<module name="SeparatorWrap"> <!-- Java Style Guide: Where to break -->
<property name="tokens" value="DOT"/>
Expand Down Expand Up @@ -425,11 +426,8 @@
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="minLineCount" value="99999999"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
</module>
<module name="JavadocStyle"/> <!-- Java Style Guide: Javadoc -->
<module name="JavadocTagContinuationIndentation"> <!-- Java Style Guide: At-clauses -->
Expand Down
1 change: 1 addition & 0 deletions .baseline/idea/intellij-java-palantir-style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<package name="" static="false" withSubpackages="true" />
</value>
</option>
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
<GroovyCodeStyleSettings>
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
Expand Down
7 changes: 2 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath 'com.netflix.nebula:nebula-publishing-plugin:17.3.2'
classpath 'com.netflix.nebula:gradle-info-plugin:9.1.1'
classpath 'com.palantir.baseline:gradle-baseline-java:3.11.0'
classpath 'com.palantir.baseline:gradle-baseline-java:3.50.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.3.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.3'
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.27.0'
Expand Down Expand Up @@ -53,10 +53,7 @@ subprojects {
}

tasks.withType(JavaCompile) {
options.errorprone.errorproneArgs += ['-Xep:PreconditionsConstantMessage:OFF',
'-Xep:PreferSafeLoggableExceptions:OFF',
'-Xep:PreferSafeLoggingPreconditions:OFF',
'-Xep:SwitchStatementDefaultCase:OFF']
options.errorprone.disable 'PreconditionsConstantMessage', 'PreferSafeLoggableExceptions', 'PreferSafeLoggingPreconditions'
}

// Run `./gradlew test -Drecreate=true` to recreate all the expected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public class PalantirJavaFormatSpotlessPlugin implements Plugin<Project> {
public void apply(Project project) {
project.getRootProject().getPluginManager().apply(PalantirJavaFormatProviderPlugin.class);

project.getPluginManager().withPlugin("java", plugin -> {
project.getPluginManager().withPlugin("java", _javaPlugin -> {
SPOTLESS_PLUGINS.forEach(
spotlessPluginId -> project.getPluginManager().withPlugin(spotlessPluginId, spotlessPlugin -> {
spotlessPluginId -> project.getPluginManager().withPlugin(spotlessPluginId, _spotlessPlugin -> {
SpotlessInterop.addSpotlessJavaStep(
project, PalantirJavaFormatProviderPlugin.CONFIGURATION_NAME);
}));
Expand Down
2 changes: 1 addition & 1 deletion idea-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ dependencies {
}

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

check.dependsOn buildPlugin, verifyPlugin
Expand Down
2 changes: 1 addition & 1 deletion palantir-java-format/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
}

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

// false positives due to org.junit.runners.* in the test cases
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.palantir.javaformat.java.FormatterDiagnostic;

/** An unchecked formatting error. */
public class FormattingError extends Error {
public class FormattingError extends RuntimeException {

private final ImmutableList<FormatterDiagnostic> diagnostics;

Expand Down