You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by re...@apache.org on 2019/01/22 04:02:14 UTC

[beam] branch master updated: add target to spotless, execute spotlessApply on missed files

This is an automated email from the ASF dual-hosted git repository.

reuvenlax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 134e069  add target to spotless, execute spotlessApply on missed files
     new e3478be  Merge pull request #7580: add target to spotless, execute spotlessApply on missed files
134e069 is described below

commit 134e06974f445efb3ea16620ef488ad2547eaa0e
Author: Michael Luckey <25...@users.noreply.github.com>
AuthorDate: Mon Jan 21 11:46:19 2019 +0100

    add target to spotless, execute spotlessApply on missed files
---
 .../org/apache/beam/gradle/BeamModulePlugin.groovy |  7 ++++
 .../apache/beam/sdk/state/StateContextsTest.java   |  3 +-
 .../src/main/java/it/pkg/StarterPipeline.java      | 47 +++++++++++-----------
 3 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
index 81cc39a..7340f8f 100644
--- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
@@ -730,6 +730,13 @@ class BeamModulePlugin implements Plugin<Project> {
         java {
           licenseHeader javaLicenseHeader
           googleJavaFormat('1.7')
+          target project.fileTree(project.projectDir) {
+            include '**/*.java'
+            exclude '**/archetype-resources/src/**'
+            exclude '**/build/generated/**'
+            exclude '**/build/generated-src/**'
+            exclude '**/build/generated-*-avro-*/**'
+          }
         }
       }
 
diff --git a/sdks/java/core/src/test/avro/org/apache/beam/sdk/state/StateContextsTest.java b/sdks/java/core/src/test/avro/org/apache/beam/sdk/state/StateContextsTest.java
index 19c25b1..8233df8 100644
--- a/sdks/java/core/src/test/avro/org/apache/beam/sdk/state/StateContextsTest.java
+++ b/sdks/java/core/src/test/avro/org/apache/beam/sdk/state/StateContextsTest.java
@@ -6,6 +6,7 @@
  * 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
@@ -13,9 +14,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
-
 package org.apache.beam.sdk.state;
 
 import static org.hamcrest.Matchers.equalTo;
diff --git a/sdks/java/maven-archetypes/starter/src/test/resources/projects/basic/reference/src/main/java/it/pkg/StarterPipeline.java b/sdks/java/maven-archetypes/starter/src/test/resources/projects/basic/reference/src/main/java/it/pkg/StarterPipeline.java
index 4ae92e8..cb8b27d 100644
--- a/sdks/java/maven-archetypes/starter/src/test/resources/projects/basic/reference/src/main/java/it/pkg/StarterPipeline.java
+++ b/sdks/java/maven-archetypes/starter/src/test/resources/projects/basic/reference/src/main/java/it/pkg/StarterPipeline.java
@@ -30,39 +30,38 @@ import org.slf4j.LoggerFactory;
 /**
  * A starter example for writing Beam programs.
  *
- * <p>The example takes two strings, converts them to their upper-case
- * representation and logs them.
+ * <p>The example takes two strings, converts them to their upper-case representation and logs them.
  *
- * <p>To run this starter example locally using DirectRunner, just
- * execute it without any additional parameters from your favorite development
- * environment.
+ * <p>To run this starter example locally using DirectRunner, just execute it without any additional
+ * parameters from your favorite development environment.
  *
- * <p>To run this starter example using managed resource in Google Cloud
- * Platform, you should specify the following command-line options:
- *   --project=<YOUR_PROJECT_ID>
- *   --stagingLocation=<STAGING_LOCATION_IN_CLOUD_STORAGE>
- *   --runner=DataflowRunner
+ * <p>To run this starter example using managed resource in Google Cloud Platform, you should
+ * specify the following command-line options: --project=<YOUR_PROJECT_ID>
+ * --stagingLocation=<STAGING_LOCATION_IN_CLOUD_STORAGE> --runner=DataflowRunner
  */
 public class StarterPipeline {
   private static final Logger LOG = LoggerFactory.getLogger(StarterPipeline.class);
 
   public static void main(String[] args) {
-    Pipeline p = Pipeline.create(
-        PipelineOptionsFactory.fromArgs(args).withValidation().create());
+    Pipeline p = Pipeline.create(PipelineOptionsFactory.fromArgs(args).withValidation().create());
 
     p.apply(Create.of("Hello", "World"))
-    .apply(MapElements.via(new SimpleFunction<String, String>() {
-      @Override
-      public String apply(String input) {
-        return input.toUpperCase();
-      }
-    }))
-    .apply(ParDo.of(new DoFn<String, Void>() {
-      @ProcessElement
-      public void processElement(ProcessContext c)  {
-        LOG.info(c.element());
-      }
-    }));
+        .apply(
+            MapElements.via(
+                new SimpleFunction<String, String>() {
+                  @Override
+                  public String apply(String input) {
+                    return input.toUpperCase();
+                  }
+                }))
+        .apply(
+            ParDo.of(
+                new DoFn<String, Void>() {
+                  @ProcessElement
+                  public void processElement(ProcessContext c) {
+                    LOG.info(c.element());
+                  }
+                }));
 
     p.run();
   }