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 Jan 30, 2020
1 parent 32b7a5b commit f25b443
Show file tree
Hide file tree
Showing 27 changed files with 52 additions and 66 deletions.
9 changes: 0 additions & 9 deletions .baseline/checkstyle/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,4 @@

<!-- Generated code should not be subjected to checkstyle. -->
<suppress files="[/\\].*[/\\]generated.*[/\\]" checks="." />

<!-- Docker Compose Rule modifications: -->
<suppress files=".*" checks="DesignForExtension" />
<suppress files=".*" checks="LineLength" />
<suppress files=".*" checks="AbbreviationAsWordInName" />
<suppress files=".*" checks="TypeName" />
<suppress files=".*" checks="AvoidStaticImport" />
<suppress files=".*" checks="OverloadMethodsDeclarationOrder" />
<suppress files=".*" checks="FinalClass" />
</suppressions>
23 changes: 11 additions & 12 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 @@ -410,7 +410,6 @@
<message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypecastParenPad"/> <!-- Java Style Guide: Horizontal whitespace -->
<module name="UnnecessaryParentheses"/>
<module name="UnusedImports"> <!-- Java Style Guide: No unused imports -->
<property name="processJavadoc" value="true"/>
</module>
Expand All @@ -422,6 +421,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 +435,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 +468,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
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
classpath 'com.netflix.nebula:gradle-info-plugin:5.2.0'
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.62.1'
classpath 'com.palantir.baseline:gradle-baseline-java:3.1.1'
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.16.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.3.0'
Expand All @@ -25,7 +25,6 @@ buildscript {

plugins {
id 'com.palantir.git-version' version '0.12.2'
id 'com.palantir.configuration-resolver' version '0.2.0'
}

apply plugin: 'com.palantir.baseline'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public abstract class DockerComposeExtension extends DockerComposeManager
implements BeforeAllCallback, AfterAllCallback {

@Override
public void beforeAll(ExtensionContext unused) throws IOException, InterruptedException {
public void beforeAll(ExtensionContext _value) throws IOException, InterruptedException {
before();
}

@Override
public void afterAll(ExtensionContext unused) {
public void afterAll(ExtensionContext _value) {
after();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,22 @@ private void runDockerComposeRule(DockerComposeManager dockerComposeManager) thr
private Optional<ClusterWaitEvent> isClusterWait(Event event) {
return event.accept(new Event.Visitor<Optional<ClusterWaitEvent>>() {
@Override
public Optional<ClusterWaitEvent> visitBuild(BuildEvent value) {
public Optional<ClusterWaitEvent> visitBuild(BuildEvent _value) {
return Optional.empty();
}

@Override
public Optional<ClusterWaitEvent> visitPull(PullEvent value) {
public Optional<ClusterWaitEvent> visitPull(PullEvent _value) {
return Optional.empty();
}

@Override
public Optional<ClusterWaitEvent> visitUp(UpEvent value) {
public Optional<ClusterWaitEvent> visitUp(UpEvent _value) {
return Optional.empty();
}

@Override
public Optional<ClusterWaitEvent> visitWaitForServices(WaitForServicesEvent value) {
public Optional<ClusterWaitEvent> visitWaitForServices(WaitForServicesEvent _value) {
return Optional.empty();
}

Expand All @@ -155,22 +155,22 @@ public Optional<ClusterWaitEvent> visitClusterWait(ClusterWaitEvent value) {
}

@Override
public Optional<ClusterWaitEvent> visitShutdownStop(ShutdownStopEvent value) {
public Optional<ClusterWaitEvent> visitShutdownStop(ShutdownStopEvent _value) {
return Optional.empty();
}

@Override
public Optional<ClusterWaitEvent> visitLogCollection(LogCollectionEvent value) {
public Optional<ClusterWaitEvent> visitLogCollection(LogCollectionEvent _value) {
return Optional.empty();
}

@Override
public Optional<ClusterWaitEvent> visitShutdown(ShutdownEvent value) {
public Optional<ClusterWaitEvent> visitShutdown(ShutdownEvent _value) {
return Optional.empty();
}

@Override
public Optional<ClusterWaitEvent> visitUnknown(String unknownType) {
public Optional<ClusterWaitEvent> visitUnknown(String _unknownType) {
return Optional.empty();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@

package com.palantir.docker.compose;

import com.google.common.collect.Sets;
import com.palantir.docker.compose.connection.Cluster;
import com.palantir.docker.compose.connection.Container;
import com.palantir.docker.compose.connection.ContainerCache;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

final class RecordingCluster extends Cluster {
private final Cluster delegate;
private final Set<String> recordedContainerNames = Sets.newConcurrentHashSet();
private final Set<String> recordedContainerNames = ConcurrentHashMap.newKeySet();

RecordingCluster(Cluster delegate) {
this.delegate = delegate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
import java.util.function.Supplier;
import java.util.stream.Collectors;

public class DaemonEnvironmentValidator implements EnvironmentValidator {
public final class DaemonEnvironmentValidator implements EnvironmentValidator {

private static final Set<String> ILLEGAL_VARIABLES = ImmutableSet.of(DOCKER_TLS_VERIFY, DOCKER_HOST, DOCKER_CERT_PATH);
private static final Supplier<DaemonEnvironmentValidator> SUPPLIER = Suppliers.memoize(
() -> new DaemonEnvironmentValidator())::get;
private static final Supplier<DaemonEnvironmentValidator> SUPPLIER =
Suppliers.memoize(() -> new DaemonEnvironmentValidator());

public static DaemonEnvironmentValidator instance() {
return SUPPLIER.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class DaemonHostIpResolver implements HostIpResolver {
public static final String LOCALHOST = "127.0.0.1";

@Override
public String resolveIp(String dockerHost) {
public String resolveIp(String _dockerHost) {
return LOCALHOST;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.Set;
import java.util.stream.Collectors;

public class RemoteEnvironmentValidator implements EnvironmentValidator {
public final class RemoteEnvironmentValidator implements EnvironmentValidator {

private static final Set<String> SECURE_VARIABLES = ImmutableSet.of(DOCKER_TLS_VERIFY, DOCKER_CERT_PATH);
private static final RemoteEnvironmentValidator VALIDATOR = new RemoteEnvironmentValidator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static ShutdownStrategy callbackAndThen(Runnable callback, ShutdownStrategy shut
return new CallbackThenDelegateShutdownStrategy(shutdownStrategy, callback);
}

default void stop(DockerCompose dockerCompose) throws IOException, InterruptedException {}
default void stop(DockerCompose _dockerCompose) throws IOException, InterruptedException {}

void shutdown(DockerCompose dockerCompose, Docker docker) throws IOException, InterruptedException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Container {
private final Docker docker;
private final DockerCompose dockerCompose;

private Supplier<Ports> portMappings = Suppliers.memoize(this::getDockerPorts)::get;
private Supplier<Ports> portMappings = Suppliers.memoize(this::getDockerPorts);

public Container(String containerName, Docker docker, DockerCompose dockerCompose) {
this.containerName = containerName;
Expand Down Expand Up @@ -94,7 +94,7 @@ public DockerPort port(int internalPort) {

public void start() throws IOException, InterruptedException {
dockerCompose.start(this);
portMappings = Suppliers.memoize(this::getDockerPorts)::get;
portMappings = Suppliers.memoize(this::getDockerPorts);
}

public void stop() throws IOException, InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.regex.Pattern;
import java.util.stream.Stream;

public class ContainerNames {
public final class ContainerNames {
private static final Pattern HEAD_PATTERN = Pattern.compile("-+(\r|\n)+");
private static final Pattern BODY_PATTERN = Pattern.compile("(\r|\n)+");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static RemoteBuilder remoteMachine() {
return new RemoteBuilder();
}

public static class RemoteBuilder {
public static final class RemoteBuilder {

private final Map<String, String> dockerEnvironment = newHashMap();
private Map<String, String> additionalEnvironment = newHashMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @see <a href="https://github.com/docker/compose/issues/3419#issuecomment-221793401">Docker Compose Issue #3419</a>
*/
public class DockerForMacHostsIssue {
public final class DockerForMacHostsIssue {

private static final String REDIRECT_LINE = "127.0.0.1 localunixsocket\n";
private static final String WARNING_MESSAGE = "\n\n **** WARNING: Your tests may be slow ****\n"
Expand Down Expand Up @@ -48,7 +48,7 @@ private static boolean localunixsocketRedirectedInEtcHosts() {
}
}

public static void main(String[] args) {
public static void main(String[] _args) {
issueWarning();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void stop(DockerCompose dockerCompose) throws IOException, InterruptedExc
}

@Override
public void shutdown(DockerCompose dockerCompose, Docker docker) throws IOException, InterruptedException {
public void shutdown(DockerCompose dockerCompose, Docker _docker) throws IOException, InterruptedException {
log.debug("Downing docker-compose cluster");
dockerCompose.down();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void stop(DockerCompose dockerCompose) throws IOException, InterruptedExc
}

@Override
public void shutdown(DockerCompose dockerCompose, Docker docker) throws IOException, InterruptedException {
public void shutdown(DockerCompose dockerCompose, Docker _docker) throws IOException, InterruptedException {
log.debug("Downing docker-compose cluster");
dockerCompose.down();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class SkipShutdownStrategy implements ShutdownStrategy {
private static final Logger log = LoggerFactory.getLogger(SkipShutdownStrategy.class);

@Override
public void shutdown(DockerCompose dockerCompose, Docker docker) {
public void shutdown(DockerCompose _dockerCompose, Docker _docker) {
log.warn("\n"
+ "******************************************************************************************\n"
+ "* docker-compose-rule has been configured to skip docker-compose shutdown: *\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
public class DoNothingLogCollector implements LogCollector {

@Override
public void collectLogs(DockerCompose dockerCompose) { }
public void collectLogs(DockerCompose _dockerCompose) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import java.util.Optional;

public class LogDirectory {
public final class LogDirectory {

private LogDirectory() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.regex.Pattern;
import java.util.stream.Stream;

class GitUtils {
final class GitUtils {
private static final Pattern SSH_REGEX = Pattern.compile(sshRegex());
private static final Pattern JUST_A_PATH = Pattern.compile("[\\w/]+", Pattern.UNICODE_CHARACTER_CLASS);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,18 @@ interface Reporter {
void addException(Exception exception);
void report();

class NoOpReporter implements Reporter {
final class NoOpReporter implements Reporter {
private static final Logger log = LoggerFactory.getLogger(NoOpReporter.class);

public static final Reporter INSTANCE = new NoOpReporter();

private NoOpReporter() { }

@Override
public void addRun(DockerComposeRun dockerComposeRun) {
}
public void addRun(DockerComposeRun _dockerComposeRun) {}

@Override
public void addException(Exception exception) {
}
public void addException(Exception _exception) {}

@Override
public void report() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.Arrays;
import java.util.List;

public class TestContainerNames {
public final class TestContainerNames {

private TestContainerNames() {}

Expand Down
Loading

0 comments on commit f25b443

Please sign in to comment.