Skip to content

Commit 1c99de0

Browse files
authored
Update CheckStyle (#75)
1. Move to updated google-checks.xml (remove the old one) 2. Tell check style to use v8.1 (instead of 6.11.2) 3. remove versions-rules 4. comment out our amendments for now in google_checks.xml 5. Fix AppTest for new check style rules. 6. update a few versions 7. prep for two new releases
1 parent 6806a62 commit 1c99de0

File tree

8 files changed

+51
-354
lines changed

8 files changed

+51
-354
lines changed

checkstyle-config/pom.xml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ limitations under the License.
1818

1919
<groupId>com.google.cloud.samples</groupId>
2020
<artifactId>checkstyle-configuration</artifactId>
21-
<version>1.0.1-SNAPSHOT</version>
21+
<version>1.0.1</version>
2222
<packaging>jar</packaging>
2323

2424
<name>${project.groupId}:${project.artifactId}</name>
@@ -78,14 +78,10 @@ limitations under the License.
7878

7979
<maven-release-plugin>2.5.3</maven-release-plugin>
8080
<nexus-staging-maven-plugin>1.6.8</nexus-staging-maven-plugin>
81-
<versions-maven-plugin>2.3</versions-maven-plugin>
81+
<versions-maven-plugin>2.4</versions-maven-plugin>
8282
<maven-gpg-plugin>1.6</maven-gpg-plugin>
8383
</properties>
8484

85-
<prerequisites>
86-
<maven>3.5.0</maven>
87-
</prerequisites>
88-
8985
<profiles>
9086
<!-- Code signing for release: http://stackoverflow.com/a/14869692/101923 -->
9187
<profile>
@@ -141,7 +137,28 @@ limitations under the License.
141137
</plugin>
142138
</plugins>
143139
</pluginManagement>
140+
144141
<plugins>
142+
143+
<plugin>
144+
<groupId>com.coderplus.maven.plugins</groupId>
145+
<artifactId>copy-rename-maven-plugin</artifactId>
146+
<version>1.0.1</version>
147+
<executions>
148+
<execution>
149+
<id>copy-resources</id>
150+
<phase>generate-sources</phase>
151+
<goals>
152+
<goal>copy</goal>
153+
</goals>
154+
<configuration>
155+
<sourceFile>../third_party/checkstyle/google_checks.xml</sourceFile>
156+
<destinationFile>target/classes/google-checks.xml</destinationFile>
157+
</configuration>
158+
</execution>
159+
</executions>
160+
</plugin>
161+
145162
<plugin>
146163
<groupId>org.codehaus.mojo</groupId>
147164
<artifactId>versions-maven-plugin</artifactId>

checkstyle-config/src/main/resources/google-checks.xml

Lines changed: 0 additions & 223 deletions
This file was deleted.

pom.xml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ limitations under the License.
1818

1919
<groupId>com.google.cloud.samples</groupId>
2020
<artifactId>shared-configuration</artifactId>
21-
<version>1.0.5-SNAPSHOT</version>
21+
<version>1.0.5</version>
2222
<packaging>pom</packaging>
2323

2424
<name>${project.groupId}:${project.artifactId}</name>
@@ -59,7 +59,7 @@ limitations under the License.
5959
<connection>scm:git:[email protected]:GoogleCloudPlatform/java-repo-tools.git</connection>
6060
<developerConnection>scm:git:[email protected]:GoogleCloudPlatform/java-repo-tools.git</developerConnection>
6161
<url>[email protected]:GoogleCloudPlatform/java-repo-tools.git</url>
62-
<tag>v1.0.4-alpha</tag>
62+
<tag>v1.0.5</tag>
6363
</scm>
6464

6565
<distributionManagement>
@@ -102,10 +102,6 @@ limitations under the License.
102102
<maven-gpg-plugin>1.6</maven-gpg-plugin>
103103
</properties>
104104

105-
<prerequisites>
106-
<maven>3.5.0</maven>
107-
</prerequisites>
108-
109105
<profiles>
110106
<!-- Code signing for release: http://stackoverflow.com/a/14869692/101923 -->
111107
<profile>
@@ -211,18 +207,25 @@ limitations under the License.
211207
<configLocation>google-checks.xml</configLocation>
212208
<consoleOutput>true</consoleOutput>
213209
<failOnViolation>true</failOnViolation>
214-
<failsOnError>true</failsOnError>
215210
<includeTestSourceDirectory>true</includeTestSourceDirectory>
216211
<suppressionsLocation>suppressions.xml</suppressionsLocation>
217212
</configuration>
218213
<dependencies>
219214
<!-- Add a dependency to use bundled resources.
220215
See: http://stackoverflow.com/a/19690484/101923 -->
216+
221217
<dependency>
222218
<groupId>com.google.cloud.samples</groupId>
223219
<artifactId>checkstyle-configuration</artifactId>
224-
<version>1.0.0</version>
220+
<version>1.0.1</version>
221+
</dependency>
222+
223+
<dependency>
224+
<groupId>com.puppycrawl.tools</groupId>
225+
<artifactId>checkstyle</artifactId>
226+
<version>8.1</version>
225227
</dependency>
228+
226229
</dependencies>
227230
<executions>
228231
<execution><goals><goal>check</goal></goals></execution>

test/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ limitations under the License.
2626
<parent>
2727
<artifactId>shared-configuration</artifactId>
2828
<groupId>com.google.cloud.samples</groupId>
29-
<version>1.0.5-SNAPSHOT</version>
29+
<version>1.0.5</version>
3030
<relativePath>..</relativePath>
3131
</parent>
3232

3333
<properties>
34-
<maven.compiler.source>1.7</maven.compiler.source> <!-- REQUIRED -->
35-
<maven.compiler.target>1.7</maven.compiler.target> <!-- REQUIRED -->
34+
<maven.compiler.source>1.8</maven.compiler.source> <!-- REQUIRED -->
35+
<maven.compiler.target>1.8</maven.compiler.target> <!-- REQUIRED -->
3636
</properties>
3737

3838
<dependencies>

test/src/test/java/com/google/cloud/samples/test/AppTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818

1919
import static com.google.common.truth.Truth.assertThat;
2020

21+
import java.io.ByteArrayOutputStream;
22+
import java.io.PrintStream;
23+
2124
import org.junit.Test;
2225
import org.junit.runner.RunWith;
2326
import org.junit.runners.JUnit4;
2427

25-
import java.io.ByteArrayOutputStream;
26-
import java.io.PrintStream;
2728

2829
/**
2930
* Unit tests for {@link App}.

third_party/checkstyle/METADATA

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ third_party {
1515
}
1616
version: "8.0"
1717
last_upgrade_date { year: 2017 month: 7 day: 24 }
18-
local_modifications: "Initial checkin."
18+
local_modifications: "SuppressWarningsFilter & SuppressionCommentFilter"
1919
}

third_party/checkstyle/google_checks.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,5 +231,15 @@
231231
<property name="exceptionVariableName" value="expected"/>
232232
</module>
233233
<module name="CommentsIndentation"/>
234+
<!-- rules for DPE GH projects -->
235+
<!-- Allow silencing rules with annotations http://stackoverflow.com/a/22556386/101923 -->
236+
<!--
237+
<module name="SuppressWarningsFilter" />
238+
-->
239+
<!-- Allow silencing with comment http://stackoverflow.com/questions/4023185 -->
240+
<!--
241+
<module name="SuppressionCommentFilter" />
242+
-->
234243
</module>
244+
235245
</module>

0 commit comments

Comments
 (0)