diff options
author | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-08-10 20:38:32 +0100 |
---|---|---|
committer | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-08-10 20:38:32 +0100 |
commit | dd13e9e08489b38548b11ce12eb8d59d2602fab6 (patch) | |
tree | 01fc18bed1c87e4cba21ee777a7febbc7315b404 /.gitlab-ci.yml | |
parent | 4cecc237979f139d72c7f4e4ccdd1b6af5a1bccd (diff) | |
download | lorry-controller-dd13e9e08489b38548b11ce12eb8d59d2602fab6.tar.gz |
gitlab-ci: Run pyflakes3 over all Python sources
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7984fcd..e51682f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,8 @@ image: python:3.6-slim-buster before_script: - apt-get update -y - apt-get install -y -qq python3-dev python3-pip + # Static checker + - apt-get install -y pyflakes3 # Deps for running tests - apt-get install -y -qq cmdtest curl git # Deps for lorry-controller @@ -12,6 +14,21 @@ before_script: - pip3 install yoyo-migrations - pip3 install pyyaml - pip3 install https://gitlab.com/trovekube/cliapp/-/archive/cliapp-1.20180812.1/cliapp-cliapp-1.20180812.1.tar.gz + +run-pyflakes: + script: + - | + { + find . -path ./.git -prune -o -name '*.py' -print + find . -path ./.git -prune -o -type f -perm /111 -print | + while read script; do + # Check for Python shebang on the first line only + if awk '/^#!.*python/ { exit 0 } { exit 1 }' "$script"; then + echo "$script" + fi + done + } | xargs pyflakes3 + run-check: script: - sh check |