From cd1cbce3918ab19aa6022d42223c01228d1ec48b Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 27 Oct 2019 11:10:58 +0100 Subject: [PATCH] build: find Python syntax errors in dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As discussed in https://github.com/nodejs/node/issues/30129#issuecomment-546662351, when we vendor in code, we own the Syntax Errors in that code. This PR adds The `.flake8` config file at the root of this repo puts blinders on the linting of our dependencies so this test disables that file before linting. fixup: allow_failures until dependencies pass PR-URL: https://github.com/nodejs/node/pull/30143 Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Michaƫl Zasso Reviewed-By: Jiawen Geng Reviewed-By: Sam Roberts --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8aa321ec1626d8..6c16bdad821f0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,3 +88,15 @@ jobs: - if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then bash -x tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST}; fi + + - name: "Find syntax errors in our Python dependencies" + language: python + python: 3.8 + install: + - mv .flake8 disabled.flake8 # take the blinders off of flake8 + - python3.8 -m pip install --upgrade pip + - python3.8 -m pip install flake8 + script: + - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + allow_failures: # TODO (cclauss): remove this when dependencies are clean + - name: "Find syntax errors in our Python dependencies"