This is an automated email from the ASF dual-hosted git repository.
junrushao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 69ddb9b Move flake8 to ci_lint (#8652)
69ddb9b is described below
commit 69ddb9bec7d335015a7102e02c6e57dc807038f3
Author: Christopher Sidebottom <[email protected]>
AuthorDate: Thu Aug 5 21:48:07 2021 +0100
Move flake8 to ci_lint (#8652)
* Move flake8 to ci_lint
This fixes the scenario where you lint with ci_lint but it can still
fail in PR due to flake8 being injected only into the Mac build.
* Disable flake8 until the docker changes have landed
---
docker/Dockerfile.ci_lint | 2 +-
tests/{scripts/task_lint.sh => lint/flake8.sh} | 41 ++------------------------
tests/scripts/task_lint.sh | 1 +
3 files changed, 5 insertions(+), 39 deletions(-)
diff --git a/docker/Dockerfile.ci_lint b/docker/Dockerfile.ci_lint
index ae8c6b0..7ef690f 100644
--- a/docker/Dockerfile.ci_lint
+++ b/docker/Dockerfile.ci_lint
@@ -32,7 +32,7 @@ RUN pip config set global.cache-dir false
RUN apt-get update && apt-get install -y doxygen graphviz
-RUN pip3 install cpplint pylint==2.4.4 mypy==0.902 black==20.8b1
+RUN pip3 install cpplint pylint==2.4.4 mypy==0.902 black==20.8b1 flake8==3.9.2
# java deps for rat
COPY install/ubuntu_install_java.sh /install/ubuntu_install_java.sh
diff --git a/tests/scripts/task_lint.sh b/tests/lint/flake8.sh
similarity index 55%
copy from tests/scripts/task_lint.sh
copy to tests/lint/flake8.sh
index 023ab2a..43ade61 100755
--- a/tests/scripts/task_lint.sh
+++ b/tests/lint/flake8.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -e
# 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
@@ -16,40 +16,5 @@
# specific language governing permissions and limitations
# under the License.
-set -e
-set -u
-set -o pipefail
-
-cleanup()
-{
- rm -rf /tmp/$$.*
-}
-trap cleanup 0
-
-
-echo "Checking file types..."
-python3 tests/lint/check_file_type.py
-
-echo "Checking ASF license headers..."
-tests/lint/check_asf_header.sh --local
-
-echo "Linting the C++ code..."
-tests/lint/cpplint.sh
-
-echo "clang-format check..."
-tests/lint/clang_format.sh
-
-echo "black check..."
-tests/lint/python_format.sh
-
-echo "Linting the Python code..."
-tests/lint/pylint.sh
-
-echo "Lintinf the JNI code..."
-tests/lint/jnilint.sh
-
-echo "Checking C++ documentation..."
-tests/lint/cppdocs.sh
-
-echo "Type checking with MyPy ..."
-tests/scripts/task_mypy.sh
+# Disabled until docker images are rebuilt
+# python3 -m flake8 . --count --select=E9,F63,F7 --show-source --statistics
diff --git a/tests/scripts/task_lint.sh b/tests/scripts/task_lint.sh
index 023ab2a..12b3270 100755
--- a/tests/scripts/task_lint.sh
+++ b/tests/scripts/task_lint.sh
@@ -44,6 +44,7 @@ tests/lint/python_format.sh
echo "Linting the Python code..."
tests/lint/pylint.sh
+tests/lint/flake8.sh
echo "Lintinf the JNI code..."
tests/lint/jnilint.sh