You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/08/17 23:56:03 UTC

[GitHub] [beam] pabloem commented on a change in pull request #12444: Added a whitespace lint as part of python lint precommit

pabloem commented on a change in pull request #12444:
URL: https://github.com/apache/beam/pull/12444#discussion_r471836163



##########
File path: .test-infra/jenkins/job_PreCommit_Whitespace.groovy
##########
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * 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 KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import PrecommitJobBuilder
+
+PrecommitJobBuilder builder = new PrecommitJobBuilder(

Review comment:
       Can you add mention of this job in `.test-infra/jenkins/README.md`? probably also in the PR template tables, please

##########
File path: sdks/python/scripts/run_whitespacelint.sh
##########
@@ -0,0 +1,56 @@
+#!/bin/bash
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file 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 KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+set -e

Review comment:
       Can you document in this file which groups of files are meant to be linted by this test?

##########
File path: sdks/python/test-suites/tox/py38/build.gradle
##########
@@ -33,3 +33,27 @@ apply from: "../common.gradle"
 
 // TODO(BEAM-8954): Remove this once tox uses isolated builds.
 testPy38Cython.mustRunAfter testPython38, testPy38CloudCoverage
+
+toxTask "whitespacelint", "whitespacelint"
+
+task archiveFilesToLint(type: Zip) {
+  archiveFileName = "files-to-whitespacelint.zip"
+  destinationDirectory = file("$buildDir/dist")
+
+  from ("$rootProject.projectDir") {
+    include "**/*.md"
+    include "**/build.gradle"
+  }
+}
+
+task unpackFilesToLint(type: Copy) {
+  from zipTree("$buildDir/dist/files-to-whitespacelint.zip")
+  into "$buildDir/files-to-whitespacelint"
+}
+
+whitespacelint.dependsOn archiveFilesToLint, unpackFilesToLint
+unpackFilesToLint.dependsOn archiveFilesToLint
+archiveFilesToLint.dependsOn cleanPython
+archiveFilesToLint.mustRunAfter cleanPython
+unpackFilesToLint.mustRunAfter cleanPython, archiveFilesToLint

Review comment:
       did you find that you needed the `mustRunAfter` rules even though you also had the `dependsOn` rules?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org