Skip to content

Commit

Permalink
Excavator: Upgrades Baseline to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-excavator-bot committed Nov 25, 2019
1 parent ce2ccb4 commit 4689ef1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 deletions.
22 changes: 11 additions & 11 deletions .baseline/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
<property name="optional" value="true"/>
</module>
<module name="SuppressWarningsFilter"/> <!-- baseline-gradle: README.md -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<module name="TreeWalker">
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
<module name="SuppressionCommentFilter">
Expand Down Expand Up @@ -84,11 +87,13 @@
<module name="AvoidStarImport"/> <!-- Java Style Guide: No wildcard imports -->
<module name="AvoidStaticImport"> <!-- Java Style Guide: No static imports -->
<property name="excludes" value="
com.google.common.base.Preconditions.*,
com.palantir.logsafe.Preconditions.*,
java.util.Collections.*,
java.util.stream.Collectors.*,
com.palantir.logsafe.Preconditions.*,
com.google.common.base.Preconditions.*,
org.apache.commons.lang3.Validate.*"/>
org.apache.commons.lang3.Validate.*,
org.assertj.core.api.Assertions.*,
org.mockito.Mockito.*"/>
</module>
<module name="ClassTypeParameterName"> <!-- Java Style Guide: Type variable names -->
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
Expand All @@ -110,7 +115,6 @@
<module name="EmptyStatement"/> <!-- Java Style Guide: One statement per line -->
<module name="EqualsHashCode"/>
<module name="FallThrough"/> <!-- Java Style Guide: Fall-through: commented -->
<module name="FinalClass"/> <!-- Java Coding Guidelines: Private constructors -->
<module name="GenericWhitespace"> <!-- Java Style Guide: Horizontal whitespace -->
<message key="ws.followed" value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded" value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
Expand Down Expand Up @@ -369,10 +373,6 @@
<property name="format" value="\bIOUtils\.toString\("/>
<property name="message" value="Prefer Guava''s [CharStreams,Files,Resources].toString to avoid charset/stream closing issues."/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="static enum"/>
<property name="message" value="Redundant ''static'' modifier."/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="\/\/TODO|\/\/ TODO(?!\([^()\s]+\): )"/>
<property name="message" value="TODO format: // TODO(#issue): explanation"/>
Expand Down Expand Up @@ -422,6 +422,7 @@
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="ignoreEnhancedForColon" value="false"/>
<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)"/>
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
Expand All @@ -435,7 +436,7 @@
</module>
<module name="CyclomaticComplexity"/> <!-- Java Coding Guidelines: Reduce Cyclomatic Complexity -->
<module name="DesignForExtension"> <!-- Java Coding Guidelines: Design for extension -->
<property name="ignoredAnnotations" value="Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/>
<property name="ignoredAnnotations" value="ParameterizedTest, Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/>
</module>
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
<property name="scope" value="public"/>
Expand Down Expand Up @@ -468,10 +469,9 @@
<module name="NestedTryDepth"/> <!-- Java Coding Guide: Try/catch blocks: never nested -->
<module name="NonEmptyAtclauseDescription"/> <!-- Java Style Guide: At-clauses -->
<module name="ParameterName"> <!-- Java Style Guide: Parameter names -->
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
<property name="format" value="^_?[a-z][a-zA-Z0-9]+$"/>
<message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc"/> <!-- Java Style Guide: General form -->
<module name="SummaryJavadocCheck"> <!-- Java Coding Guidelines: Javadoc -->
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ buildscript {
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.netflix.nebula:nebula-publishing-plugin:14.1.1'
classpath 'com.palantir.baseline:gradle-baseline-java:0.65.0'
classpath 'com.palantir.baseline:gradle-baseline-java:2.35.2'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,18 @@ public void testInvalidUnits() {

@Test
public void testEquals() {
assertThat(HumanReadableByteCount.bytes(1024).equals(HumanReadableByteCount.kibibytes(1))).isTrue();
assertThat(HumanReadableByteCount.bytes(1).equals(HumanReadableByteCount.valueOf("1"))).isTrue();
assertThat(HumanReadableByteCount.mebibytes(1024).equals(HumanReadableByteCount.gibibytes(1))).isTrue();
assertThat(HumanReadableByteCount.tebibytes(1024).equals(HumanReadableByteCount.pebibytes(1))).isTrue();
assertThat(HumanReadableByteCount.bytes(1024).equals(HumanReadableByteCount.mebibytes(1))).isFalse();
assertThat(HumanReadableByteCount.bytes(1024)).isEqualTo(HumanReadableByteCount.kibibytes(1));
assertThat(HumanReadableByteCount.bytes(1)).isEqualTo(HumanReadableByteCount.valueOf("1"));
assertThat(HumanReadableByteCount.mebibytes(1024)).isEqualTo(HumanReadableByteCount.gibibytes(1));
assertThat(HumanReadableByteCount.tebibytes(1024)).isEqualTo(HumanReadableByteCount.pebibytes(1));
assertThat(HumanReadableByteCount.bytes(1024)).isNotEqualTo(HumanReadableByteCount.mebibytes(1));
}

@Test
public void testCompareTo() {
assertThat(HumanReadableByteCount.bytes(2048).compareTo(HumanReadableByteCount.kibibytes(1))).isEqualTo(1);
assertThat(HumanReadableByteCount.bytes(1024).compareTo(HumanReadableByteCount.kibibytes(1))).isEqualTo(0);
assertThat(HumanReadableByteCount.bytes(1024).compareTo(HumanReadableByteCount.kibibytes(1)))
.isZero();
assertThat(HumanReadableByteCount.mebibytes(1).compareTo(HumanReadableByteCount.gibibytes(1))).isEqualTo(-1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,19 @@ public void testInvalidUnits() {

@Test
public void testEquals() {
assertThat(HumanReadableDuration.nanoseconds(1000).equals(HumanReadableDuration.microseconds(1))).isTrue();
assertThat(HumanReadableDuration.microseconds(1000).equals(HumanReadableDuration.milliseconds(1))).isTrue();
assertThat(HumanReadableDuration.milliseconds(1000).equals(HumanReadableDuration.seconds(1))).isTrue();
assertThat(HumanReadableDuration.seconds(60).equals(HumanReadableDuration.minutes(1))).isTrue();
assertThat(HumanReadableDuration.minutes(60).equals(HumanReadableDuration.hours(1))).isTrue();
assertThat(HumanReadableDuration.hours(24).equals(HumanReadableDuration.days(1))).isTrue();
assertThat(HumanReadableDuration.nanoseconds(1000)).isEqualTo(HumanReadableDuration.microseconds(1));
assertThat(HumanReadableDuration.microseconds(1000)).isEqualTo(HumanReadableDuration.milliseconds(1));
assertThat(HumanReadableDuration.milliseconds(1000)).isEqualTo(HumanReadableDuration.seconds(1));
assertThat(HumanReadableDuration.seconds(60)).isEqualTo(HumanReadableDuration.minutes(1));
assertThat(HumanReadableDuration.minutes(60)).isEqualTo(HumanReadableDuration.hours(1));
assertThat(HumanReadableDuration.hours(24)).isEqualTo(HumanReadableDuration.days(1));
}

@Test
public void testCompareTo() {
assertThat(HumanReadableDuration.seconds(70).compareTo(HumanReadableDuration.minutes(1))).isEqualTo(1);
assertThat(HumanReadableDuration.seconds(86400).compareTo(HumanReadableDuration.days(1))).isEqualTo(0);
assertThat(HumanReadableDuration.seconds(86400).compareTo(HumanReadableDuration.days(1)))
.isZero();
assertThat(HumanReadableDuration.microseconds(100).compareTo(HumanReadableDuration.seconds(1))).isEqualTo(-1);
}

Expand Down

0 comments on commit 4689ef1

Please sign in to comment.