From 605c4af9c6a031052ee5f428d77522bfe24c1483 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Thu, 30 Jan 2020 23:35:36 +0000 Subject: [PATCH] ci:split checks into py & go jobs --- .travis.yml | 11 +++++++++-- scripts/ci/check_patch.sh | 9 ++++++--- scripts/ci/check_scripts.sh | 7 +++++++ 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100755 scripts/ci/check_scripts.sh diff --git a/.travis.yml b/.travis.yml index c2851ed79..62f6dd39f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,14 +24,21 @@ stages: jobs: include: # patch formatting checks - - name: "Check patch formatting" + - name: "Python formatting" stage: check + os: linux + language: python + python: 3.7 + before_install: + install: + script: ./scripts/ci/check_patch.sh + - name: "Script formatting" os: linux language: go go: 1.13 before_install: install: - script: ./scripts/ci/check_patch.sh + script: ./scripts/ci/check_scripts.sh # test jobs - name: "3.7 on Windows" stage: test diff --git a/scripts/ci/check_patch.sh b/scripts/ci/check_patch.sh index 7d64b88d8..b1935da6a 100755 --- a/scripts/ci/check_patch.sh +++ b/scripts/ci/check_patch.sh @@ -3,10 +3,13 @@ set -x set -e -python3 -m pip install --user Pygments collective.checkdocs pre-commit +pip install Pygments collective.checkdocs pre-commit # stop the build if there are any readme formatting errors -python3 setup.py checkdocs +python setup.py checkdocs # stop the build if there are any formatting errors -GO111MODULE=on pre-commit run --all-files +err=0 +pre-commit run --all-files black || err=1 +pre-commit run --all-files flake8 || err=1 +exit $err diff --git a/scripts/ci/check_scripts.sh b/scripts/ci/check_scripts.sh new file mode 100755 index 000000000..90bc79597 --- /dev/null +++ b/scripts/ci/check_scripts.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -x +set -e + +# stop the build if there are any formatting errors +GO111MODULE=on pre-commit run --all-files shfmt