summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2020-08-12 13:36:44 +0000
committerBen Brown <ben.brown@codethink.co.uk>2020-08-12 13:36:44 +0000
commit4453c29e7812deb3c64a479e16bcad571a29f825 (patch)
tree570f4c73bd552a20de1046cc9d75f18e6a615b4c
parentc2f91a52e122853795b4fb045fda8f71d1f8f5a2 (diff)
parentb0a842f22bfeaa4c550296e5382f7dd8b6a485eb (diff)
downloadlorry-4453c29e7812deb3c64a479e16bcad571a29f825.tar.gz
Merge branch 'bwh/pyflakes' into 'master'
Fix pyflakes warning; add it to CI configuration See merge request CodethinkLabs/lorry/lorry!16
-rw-r--r--.gitlab-ci.yml17
-rwxr-xr-xlorry.zip-importer1
2 files changed, 17 insertions, 1 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
diff --git a/lorry.zip-importer b/lorry.zip-importer
index 5e035ce..6d973dd 100755
--- a/lorry.zip-importer
+++ b/lorry.zip-importer
@@ -18,7 +18,6 @@ import os.path
import struct
import subprocess
import sys
-import time
from zipfile import ZipFile