CI: flake8: adjust for 'pmbootstrap ci' (MR 3608)

This commit is contained in:
Oliver Smith 2022-10-30 15:21:20 +01:00
parent a2f75963bf
commit 613aa1c68a
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 17 additions and 2 deletions

14
.ci/flake8.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh -e
# Description: lint CI related python scripts/tests
# https://postmarktos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add py3-flake8
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
# shellcheck disable=SC2046
flake8 --ignore E501,F401,E722,W504,W605 $(find .ci -name '*.py')

View file

@ -36,7 +36,7 @@ wiki:
- .ci/wiki.sh
# testcases linting
testcases-linting:
flake8:
stage: lint
<<: *only-default
only:
@ -48,7 +48,8 @@ testcases-linting:
before_script:
- apk -q add py-flake8
script:
- flake8 --ignore E501,F401,E722,W504,W605
- .ci/lib/gitlab_prepare_ci.sh
- .ci/flake8.sh
# shellcheck
shellcheck: