flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [02/15] flink git commit: [FLINK-6728] Activate strict checkstyle for flink-quickstart
Date Fri, 26 May 2017 19:16:11 GMT
[FLINK-6728] Activate strict checkstyle for flink-quickstart

This closes #3996.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/81798e66
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/81798e66
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/81798e66

Branch: refs/heads/master
Commit: 81798e66b1e8ca96a2e4da00d662d9c153f42062
Parents: 6445da0
Author: zentol <chesnay@apache.org>
Authored: Fri May 26 09:47:11 2017 +0200
Committer: zentol <chesnay@apache.org>
Committed: Fri May 26 19:17:52 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/flink/quickstart/Dummy.java |  1 -
 .../src/main/java/BatchJob.java                 |  8 ++---
 .../main/java/SocketTextStreamWordCount.java    | 22 +++++-------
 .../src/main/java/StreamingJob.java             |  8 ++---
 .../src/main/java/WordCount.java                |  7 ++--
 .../projects/testArtifact/archetype.properties  |  4 +--
 .../java/org/apache/flink/quickstart/Dummy.java |  1 -
 .../projects/testArtifact/archetype.properties  |  4 +--
 flink-quickstart/pom.xml                        | 35 ++++++++++++++++++++
 9 files changed, 59 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/81798e66/flink-quickstart/flink-quickstart-java/src/main/java/org/apache/flink/quickstart/Dummy.java
----------------------------------------------------------------------
diff --git a/flink-quickstart/flink-quickstart-java/src/main/java/org/apache/flink/quickstart/Dummy.java
b/flink-quickstart/flink-quickstart-java/src/main/java/org/apache/flink/quickstart/Dummy.java
index b9a76d2..b590d76 100644
--- a/flink-quickstart/flink-quickstart-java/src/main/java/org/apache/flink/quickstart/Dummy.java
+++ b/flink-quickstart/flink-quickstart-java/src/main/java/org/apache/flink/quickstart/Dummy.java
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.quickstart;
 
 /**

http://git-wip-us.apache.org/repos/asf/flink/blob/81798e66/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/BatchJob.java
----------------------------------------------------------------------
diff --git a/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/BatchJob.java
b/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/BatchJob.java
index a64742f..d0e68a4 100644
--- a/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/BatchJob.java
+++ b/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/BatchJob.java
@@ -23,10 +23,10 @@ import org.apache.flink.api.java.ExecutionEnvironment;
 /**
  * Skeleton for a Flink Batch Job.
  *
- * For a full example of a Flink Batch Job, see the WordCountJob.java file in the
+ * <p>For a full example of a Flink Batch Job, see the WordCountJob.java file in the
  * same package/directory or have a look at the website.
  *
- * You can also generate a .jar file that you can submit on your Flink
+ * <p>You can also generate a .jar file that you can submit on your Flink
  * cluster.
  * Just type
  * 		mvn clean package
@@ -36,9 +36,9 @@ import org.apache.flink.api.java.ExecutionEnvironment;
  * From the CLI you can then run
  * 		./bin/flink run -c ${package}.BatchJob target/${artifactId}-${version}.jar
  *
- * For more information on the CLI see:
+ * <p>For more information on the CLI see:
  *
- * http://flink.apache.org/docs/latest/apis/cli.html
+ * <p>http://flink.apache.org/docs/latest/apis/cli.html
  */
 public class BatchJob {
 

http://git-wip-us.apache.org/repos/asf/flink/blob/81798e66/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/SocketTextStreamWordCount.java
----------------------------------------------------------------------
diff --git a/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/SocketTextStreamWordCount.java
b/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/SocketTextStreamWordCount.java
index abd62bb..97df489 100644
--- a/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/SocketTextStreamWordCount.java
+++ b/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/SocketTextStreamWordCount.java
@@ -27,26 +27,22 @@ import org.apache.flink.util.Collector;
  * This example shows an implementation of WordCount with data from a text
  * socket. To run the example make sure that the service providing the text data
  * is already up and running.
- * 
- * <p>
- * To start an example socket text stream on your local machine run netcat from
+ *
+ * <p>To start an example socket text stream on your local machine run netcat from
  * a command line: <code>nc -lk 9999</code>, where the parameter specifies the
  * port number.
- * 
- * 
- * <p>
- * Usage:
+ *
+ * <p>Usage:
  * <code>SocketTextStreamWordCount &lt;hostname&gt; &lt;port&gt;</code>
  * <br>
- * 
- * <p>
- * This example shows how to:
+ *
+ * <p>This example shows how to:
  * <ul>
  * <li>use StreamExecutionEnvironment.socketTextStream
  * <li>write a simple Flink program
  * <li>write and use user-defined functions
  * </ul>
- * 
+ *
  * @see <a href="www.openbsd.org/cgi-bin/man.cgi?query=nc">netcat</a>
  */
 public class SocketTextStreamWordCount {
@@ -92,7 +88,7 @@ public class SocketTextStreamWordCount {
 	/**
 	 * Implements the string tokenizer that splits sentences into words as a user-defined
 	 * FlatMapFunction. The function takes a line (String) and splits it into
-	 * multiple pairs in the form of "(word,1)" (Tuple2<String, Integer>).
+	 * multiple pairs in the form of "(word,1)" (Tuple2&lt;String, Integer&gt;).
 	 */
 	public static final class LineSplitter implements FlatMapFunction<String, Tuple2<String,
Integer>> {
 
@@ -108,5 +104,5 @@ public class SocketTextStreamWordCount {
 				}
 			}
 		}
-	}	
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/81798e66/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/StreamingJob.java
----------------------------------------------------------------------
diff --git a/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/StreamingJob.java
b/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/StreamingJob.java
index 2b15755..45a67ae 100644
--- a/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/StreamingJob.java
+++ b/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/StreamingJob.java
@@ -24,10 +24,10 @@ import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
 /**
  * Skeleton for a Flink Streaming Job.
  *
- * For a full example of a Flink Streaming Job, see the SocketTextStreamWordCount.java
+ * <p>For a full example of a Flink Streaming Job, see the SocketTextStreamWordCount.java
  * file in the same package/directory or have a look at the website.
  *
- * You can also generate a .jar file that you can submit on your Flink
+ * <p>You can also generate a .jar file that you can submit on your Flink
  * cluster.
  * Just type
  * 		mvn clean package
@@ -37,9 +37,9 @@ import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
  * From the CLI you can then run
  * 		./bin/flink run -c ${package}.StreamingJob target/${artifactId}-${version}.jar
  *
- * For more information on the CLI see:
+ * <p>For more information on the CLI see:
  *
- * http://flink.apache.org/docs/latest/apis/cli.html
+ * <p>http://flink.apache.org/docs/latest/apis/cli.html
  */
 public class StreamingJob {
 

http://git-wip-us.apache.org/repos/asf/flink/blob/81798e66/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/WordCount.java
----------------------------------------------------------------------
diff --git a/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/WordCount.java
b/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/WordCount.java
index 6202238..6c95389 100644
--- a/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/WordCount.java
+++ b/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/src/main/java/WordCount.java
@@ -18,9 +18,9 @@ package ${package};
  * limitations under the License.
  */
 
+import org.apache.flink.api.common.functions.FlatMapFunction;
 import org.apache.flink.api.java.DataSet;
 import org.apache.flink.api.java.ExecutionEnvironment;
-import org.apache.flink.api.common.functions.FlatMapFunction;
 import org.apache.flink.api.java.tuple.Tuple2;
 import org.apache.flink.util.Collector;
 
@@ -28,8 +28,7 @@ import org.apache.flink.util.Collector;
  * Implements the "WordCount" program that computes a simple word occurrence histogram
  * over some sample data
  *
- * <p>
- * This example shows how to:
+ * <p>This example shows how to:
  * <ul>
  * <li>write a simple Flink program.
  * <li>use Tuple data types.
@@ -75,7 +74,7 @@ public class WordCount {
 	/**
 	 * Implements the string tokenizer that splits sentences into words as a user-defined
 	 * FlatMapFunction. The function takes a line (String) and splits it into
-	 * multiple pairs in the form of "(word,1)" (Tuple2<String, Integer>).
+	 * multiple pairs in the form of "(word,1)" (Tuple2&lt;String, Integer&gt;).
 	 */
 	public static final class LineSplitter implements FlatMapFunction<String, Tuple2<String,
Integer>> {
 

http://git-wip-us.apache.org/repos/asf/flink/blob/81798e66/flink-quickstart/flink-quickstart-java/src/test/resources/projects/testArtifact/archetype.properties
----------------------------------------------------------------------
diff --git a/flink-quickstart/flink-quickstart-java/src/test/resources/projects/testArtifact/archetype.properties
b/flink-quickstart/flink-quickstart-java/src/test/resources/projects/testArtifact/archetype.properties
index 3f1bbd3..bfce480 100644
--- a/flink-quickstart/flink-quickstart-java/src/test/resources/projects/testArtifact/archetype.properties
+++ b/flink-quickstart/flink-quickstart-java/src/test/resources/projects/testArtifact/archetype.properties
@@ -5,9 +5,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 # http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/flink/blob/81798e66/flink-quickstart/flink-quickstart-scala/src/main/java/org/apache/flink/quickstart/Dummy.java
----------------------------------------------------------------------
diff --git a/flink-quickstart/flink-quickstart-scala/src/main/java/org/apache/flink/quickstart/Dummy.java
b/flink-quickstart/flink-quickstart-scala/src/main/java/org/apache/flink/quickstart/Dummy.java
index b9a76d2..b590d76 100644
--- a/flink-quickstart/flink-quickstart-scala/src/main/java/org/apache/flink/quickstart/Dummy.java
+++ b/flink-quickstart/flink-quickstart-scala/src/main/java/org/apache/flink/quickstart/Dummy.java
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.quickstart;
 
 /**

http://git-wip-us.apache.org/repos/asf/flink/blob/81798e66/flink-quickstart/flink-quickstart-scala/src/test/resources/projects/testArtifact/archetype.properties
----------------------------------------------------------------------
diff --git a/flink-quickstart/flink-quickstart-scala/src/test/resources/projects/testArtifact/archetype.properties
b/flink-quickstart/flink-quickstart-scala/src/test/resources/projects/testArtifact/archetype.properties
index 3f1bbd3..bfce480 100644
--- a/flink-quickstart/flink-quickstart-scala/src/test/resources/projects/testArtifact/archetype.properties
+++ b/flink-quickstart/flink-quickstart-scala/src/test/resources/projects/testArtifact/archetype.properties
@@ -5,9 +5,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 # http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/flink/blob/81798e66/flink-quickstart/pom.xml
----------------------------------------------------------------------
diff --git a/flink-quickstart/pom.xml b/flink-quickstart/pom.xml
index ea669cd..29befc8 100644
--- a/flink-quickstart/pom.xml
+++ b/flink-quickstart/pom.xml
@@ -92,6 +92,41 @@ under the License.
 					</delimiters>
 				</configuration>
 			</plugin>
+
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-checkstyle-plugin</artifactId>
+				<version>2.17</version>
+				<dependencies>
+					<dependency>
+						<groupId>com.puppycrawl.tools</groupId>
+						<artifactId>checkstyle</artifactId>
+						<version>6.19</version>
+					</dependency>
+				</dependencies>
+				<configuration>
+					<configLocation>/tools/maven/strict-checkstyle.xml</configLocation>
+					<suppressionsLocation>/tools/maven/suppressions.xml</suppressionsLocation>
+					<includeTestSourceDirectory>true</includeTestSourceDirectory>
+					<logViolationsToConsole>true</logViolationsToConsole>
+					<failOnViolation>true</failOnViolation>
+				</configuration>
+				<executions>
+					<!--
+					Execute checkstyle after compilation but before tests.
+
+					This ensures that any parsing or type checking errors are from
+					javac, so they look as expected. Beyond that, we want to
+					fail as early as possible.
+					-->
+					<execution>
+						<phase>test-compile</phase>
+						<goals>
+							<goal>check</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
 		</plugins>
 		<resources>
 			<resource>


Mime
View raw message