diff options
author | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-08-10 19:51:40 +0100 |
---|---|---|
committer | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-08-10 19:51:40 +0100 |
commit | b0a842f22bfeaa4c550296e5382f7dd8b6a485eb (patch) | |
tree | ea63a26877ffbe302c25a6982b7b270e97bbcc33 | |
parent | 03e047569df8585d52f22bec04958f5eb748f24a (diff) | |
download | lorry-b0a842f22bfeaa4c550296e5382f7dd8b6a485eb.tar.gz |
gitlab-ci: Run pyflakes3 over all Python sources
-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 e682625..3a23b4e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,9 @@ 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 @@ -17,6 +20,20 @@ before_script: - git config --global user.name "Lorry Baserocker" - bzr whoami "Lorry Baserocker <jdoe@example.com>" +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 |