gitlab-ci: port lint_* job to Debian/bookworm for stability

This saves us from being surprised by new rules in pylint, pyflakes, etc
like:
https://gitlab.com/FestplattenSchnitzel/fdroidserver/-/jobs/3895256515
This commit is contained in:
Hans-Christoph Steiner 2023-03-08 22:18:22 +01:00
parent ae2b33dab3
commit 4282d34343
2 changed files with 20 additions and 8 deletions

View File

@ -182,13 +182,29 @@ gradlew-fdroid:
# Run all the various linters and static analysis tools.
lint_format_safety_bandit_checks:
image: alpine:3.16
image: debian:bookworm-slim
variables:
LANG: C.UTF-8
script:
- apk add --no-cache bash build-base dash ca-certificates gcc git python3 python3-dev
- python3 -m ensurepip
- $pip install Babel bandit pycodestyle pyflakes pylint safety
- apt-get update
- apt-get -y install --no-install-recommends
bash
ca-certificates
dash
gcc
gettext
git
make
pycodestyle
pyflakes3
pylint
python3-babel
python3-dev
python3-git
python3-nose
python3-pip
python3-yaml
- $pip install --break-system-packages bandit safety
- export EXITVALUE=0
- function set_error() { export EXITVALUE=1; printf "\x1b[31mERROR `history|tail -2|head -1|cut -b 6-500`\x1b[0m\n"; }
- ./hooks/pre-commit || set_error
@ -206,7 +222,6 @@ lint_format_safety_bandit_checks:
tests/*.py
tests/*.TestCase
|| set_error
- apk add --no-cache gettext make
- make -C locale compile || set_error
- rm -f locale/*/*/*.mo
- pybabel compile --domain=fdroidserver --directory locale 2>&1 | (grep -F "error:" && exit 1) || true

View File

@ -52,8 +52,6 @@ confidence = ["HIGH", "INFERENCE"]
# TODO many of these could be fixed if someone wants to spend the time
disable = [
"broad-exception-caught",
"broad-exception-raised",
"consider-iterating-dictionary",
"consider-using-sys-exit",
"invalid-name",
@ -65,7 +63,6 @@ disable = [
"no-else-raise",
"no-else-return",
"no-member",
"pointless-exception-statement",
"subprocess-run-check",
"use-dict-literal",
]