Skip to content

Commit

Permalink
JCLOUDS-1497: Fix checkstyle-suppressions for jcloud-labs (apache#27)
Browse files Browse the repository at this point in the history
* Fix NoWhitespaceBefore Checkstyle Violation

* checkstyle updates: remove suppressionsfilter from checkstyle.xml

* suppressions now done in maven-checkstyle-plugin
  • Loading branch information
oflebbe authored and nacx committed May 7, 2019
1 parent f1d4f90 commit 92a3c68
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void testListResourceLimits() throws SecurityException, NoSuchMethodExcep

public void testListResourceLimitsOptions() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(LimitApi.class, "listResourceLimits", ListResourceLimitsOptions[].class);
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(ListResourceLimitsOptions.Builder.account("jclouds" , "23")));
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(ListResourceLimitsOptions.Builder.account("jclouds", "23")));

assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=listResourceLimits&listAll=true&account=jclouds&domainid=23 HTTP/1.1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public void testAuthorizeIngressPortsToSecurityGroups() throws SecurityException
.addQueryParam("cidrlist", "1.1.1.1/24,1.2.2.2/16").build();

public void testAuthorizeIngressICMPToCIDRs() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(SecurityGroupApi.class, "authorizeIngressICMPToCIDRs", String.class , int.class,
Invokable<?, ?> method = method(SecurityGroupApi.class, "authorizeIngressICMPToCIDRs", String.class, int.class,
int.class, Iterable.class, AccountInDomainOptions[].class);
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(2, 22, 22, ImmutableSet.of("1.1.1.1/24", "1.2.2.2/16")));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ public void testEC2() {
.imageId("ami-60a54009").instanceId("i-2be64332").instanceState(InstanceState.PENDING).rawState(
"pending").instanceType(InstanceType.M1_SMALL).keyName("example-key-name").launchTime(
dateService.iso8601DateParse("2007-08-07T11:51:50.000Z"))// MonitoringState.ENABLED,
.availabilityZone("us-east-1b").build())

, "AIDADH4IGTRXXKCD", null, "r-47a5402e");
.availabilityZone("us-east-1b").build()),
"AIDADH4IGTRXXKCD", null, "r-47a5402e");

RunInstancesResponseHandler handler = injector.getInstance(RunInstancesResponseHandler.class);
addDefaultRegionToHandler(handler);
Expand All @@ -93,8 +92,8 @@ public void testCloudBridge() {
.imageId("qmi-9ac92558").instanceId("i-01b0dac3").instanceState(InstanceState.PENDING).rawState(
"pending").instanceType(InstanceType.M1_SMALL).keyName("jclouds#greenqloud-computeblock#35")
.launchTime(dateService.iso8601DateParse("2012-06-15T19:06:35.000+00:00"))
.rootDeviceType(RootDeviceType.EBS).availabilityZone("is-1a").build())
, "56eeacd9-c790-45c3-85f3-e4380b55e1d8<", null, "r-f847a6ca");
.rootDeviceType(RootDeviceType.EBS).availabilityZone("is-1a").build()),
"56eeacd9-c790-45c3-85f3-e4380b55e1d8<", null, "r-f847a6ca");

RunInstancesResponseHandler handler = injector.getInstance(RunInstancesResponseHandler.class);
addDefaultRegionToHandler(handler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class AvailabilityZone {
private final String name;
private final ZoneState state;

@ConstructorProperties({"zoneName" , "zoneState"})
@ConstructorProperties({"zoneName", "zoneState"})
protected AvailabilityZone(String name, ZoneState state) {
this.name = name;
this.state = state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public String toString() {
private final ZoneState state;
private final Map<String, Map<String, HostService>> hosts;

@ConstructorProperties({"zoneName" , "zoneState", "hosts"})
@ConstructorProperties({"zoneName", "zoneState", "hosts"})
protected AvailabilityZoneDetails(String name, ZoneState state, Map<String, Map<String, HostService>> hosts) {
this.name = name;
this.state = state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class Hypervisor {
@Nullable
public abstract String getName();

@SerializedNames({"id" , "hypervisor_hostname"})
@SerializedNames({"id", "hypervisor_hostname"})
private static Hypervisor create(String id, String name) {
return new AutoValue_Hypervisor(id, name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class AvailabilityZone {
private final String name;
private final ZoneState state;

@ConstructorProperties({"zoneName" , "zoneState"})
@ConstructorProperties({"zoneName", "zoneState"})
protected AvailabilityZone(String name, ZoneState state) {
this.name = name;
this.state = state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public void testTempAuthRequestWithCustomHeader() throws Exception {
final String headerName = "X-Auth-User";
final String headerPass = "X-Auth-Pass";
Properties overrides = new Properties();
overrides.setProperty(TempAuthHeaders.TEMP_AUTH_HEADER_USER , headerName);
overrides.setProperty(TempAuthHeaders.TEMP_AUTH_HEADER_PASS , headerPass);
overrides.setProperty(TempAuthHeaders.TEMP_AUTH_HEADER_USER, headerName);
overrides.setProperty(TempAuthHeaders.TEMP_AUTH_HEADER_PASS, headerPass);
// with specific Header Name values
test(overrides, headerName, headerPass);
}
Expand Down
6 changes: 5 additions & 1 deletion project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.15</version>
<version>3.0.0</version>
<!-- configuration and dependencies set via profiles -->
<executions>
<execution>
Expand Down Expand Up @@ -1142,6 +1142,8 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>../resources/checkstyle.xml</configLocation>
<suppressionsLocation>../resources/checkstyle-suppressions.xml</suppressionsLocation>
<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<failOnViolation>true</failOnViolation>
<failsOnError>true</failsOnError>
Expand Down Expand Up @@ -1328,6 +1330,8 @@
<configuration>
<!-- jclouds-resources has the checkstyle config in the classpath -->
<configLocation>resources/checkstyle.xml</configLocation>
<suppressionsLocation>resources/checkstyle-suppressions.xml</suppressionsLocation>
<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<failOnViolation>true</failOnViolation>
<failsOnError>true</failsOnError>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static TemplateParameters create(TemplateParameterType publicKeyFromAzure
@Nullable
public abstract List<?> outputs();

@SerializedNames({"$schema", "contentVersion", "parameters", "variables", "resources" , "outputs"})
@SerializedNames({"$schema", "contentVersion", "parameters", "variables", "resources", "outputs"})
public static DeploymentTemplate create(final String schema,
final String contentVersion,
final TemplateParameters parameters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void testCanGetConfiguredRegions() {
.endpoint("https://lon.identity.api.rackspacecloud.com/v2.0/tokens")
.addHeader("Accept", "application/json")
.payload(payloadFromStringWithContentType(
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}"
, "application/json")).build();
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}",
"application/json")).build();


HttpResponse authenticationResponse = HttpResponse.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void testCanGetConfiguredRegions() {
.endpoint("https://identity.api.rackspacecloud.com/v2.0/tokens")
.addHeader("Accept", "application/json")
.payload(payloadFromStringWithContentType(
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}"
, "application/json")).build();
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}",
"application/json")).build();


HttpResponse authenticationResponse = HttpResponse.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void testCanGetConfiguredRegions() {
.endpoint("https://lon.identity.api.rackspacecloud.com/v2.0/tokens")
.addHeader("Accept", "application/json")
.payload(payloadFromStringWithContentType(
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}"
, "application/json")).build();
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}",
"application/json")).build();


HttpResponse authenticationResponse = HttpResponse.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void testCanGetConfiguredRegions() {
.endpoint("https://identity.api.rackspacecloud.com/v2.0/tokens")
.addHeader("Accept", "application/json")
.payload(payloadFromStringWithContentType(
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}"
, "application/json")).build();
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}",
"application/json")).build();


HttpResponse authenticationResponse = HttpResponse.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void testCanGetConfiguredRegions() {
.endpoint("https://lon.identity.api.rackspacecloud.com/v2.0/tokens")
.addHeader("Accept", "application/json")
.payload(payloadFromStringWithContentType(
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}"
, "application/json")).build();
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}",
"application/json")).build();


HttpResponse authenticationResponse = HttpResponse.builder().statusCode(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void testCanGetConfiguredRegions() {
.endpoint("https://identity.api.rackspacecloud.com/v2.0/tokens")
.addHeader("Accept", "application/json")
.payload(payloadFromStringWithContentType(
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}"
, "application/json")).build();
"{\"auth\":{\"RAX-KSKEY:apiKeyCredentials\":{\"username\":\"myUsername\",\"apiKey\":\"myApiKey\"}}}",
"application/json")).build();


HttpResponse authenticationResponse = HttpResponse.builder().statusCode(200)
Expand Down
6 changes: 1 addition & 5 deletions resources/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</module>
<module name="NoWhitespaceBefore"/>
<module name="RedundantImport"/>
<module name="RedundantModifier"/>
<!-- <module name="RedundantModifier"/> -->
<module name="SimplifyBooleanExpression"/>
<module name="TypeName"/>
<module name="UnnecessaryParentheses"/>
Expand Down Expand Up @@ -97,8 +97,4 @@
<property name="message" value="Do not use Windows line endings"/>
<property name="fileExtensions" value="java,xml,json"/>
</module>

<module name="SuppressionFilter">
<property name="file" value="resources/checkstyle-suppressions.xml"/>
</module>
</module>
1 change: 1 addition & 0 deletions resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<directory>${project.basedir}</directory>
<includes>
<include>checkstyle.xml</include>
<include>checkstyle-suppressions.xml</include>
<include>modernizer_exclusions.txt</include>
</includes>
</resource>
Expand Down

0 comments on commit 92a3c68

Please sign in to comment.