ci: add .flake8 linting to ci scripts and tests

Currently the ci scripts and tests don't have any linting checks. Add
.flake8 linting to start adding some consistency to the scripts. Ignore
most of the existing errors until they can be addressed on an individual
basis.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32602>
This commit is contained in:
Deborah Brouwer
2024-12-16 15:45:42 -08:00
committed by Marge Bot
parent e274d27be5
commit 7994a3b17a
3 changed files with 43 additions and 0 deletions

33
.gitlab-ci/.flake8 Normal file
View File

@@ -0,0 +1,33 @@
[flake8]
exclude = .venv*,
# PEP 8 Style Guide limits line length to 79 characters
max-line-length = 167
ignore =
# continuation line under-indented for hanging indent
E121
# continuation line over-indented for hanging indent
E126,
# continuation line under-indented for visual indent
E128,
# whitespace before ':'
E203,
# missing whitespace around arithmetic operator
E226,
# missing whitespace after ','
E231,
# expected 2 blank lines, found 1
E302,
# too many blank lines
E303,
# imported but unused
F401,
# f-string is missing placeholders
F541,
# local variable assigned to but never used
F841,
# line break before binary operator
W503,
# line break after binary operator
W504,

View File

@@ -54,3 +54,9 @@ PYTHONPATH="${LIB_TEST_DIR}:${SCRIPT_TEST_DIR}:${PYTHONPATH:-}" python3 -m \
${PYTEST_VERBOSE:-}
section_end pytest
section_start flake8 "flake8"
flake8 \
--config "${CI_PROJECT_DIR}/.gitlab-ci/.flake8" \
"${LIB_TEST_DIR}" "${SCRIPT_TEST_DIR}"
section_end flake8

View File

@@ -1,8 +1,12 @@
# If you change these requirements, and you need these packages
# to be available in the debian/x86_64_pyutils container
# then bump the DEBIAN_PYUTILS_TAG
PyYAML==6.*
colorama==0.4.*
filecache==0.81
filelock==3.*
fire==0.5.0
flake8==7.*
gql==3.*
kaleido==0.2.*
lavacli==1.5.2