pytests: add python lint checks

parent a890ec9a
......@@ -268,6 +268,18 @@ test:linux:amd64:valgrind:
- linux
- amd64
pytests:lint:
stage: test
dependencies: []
except:
- master
script:
- ./ci/pytests/lint.sh
tags:
- docker
- linux
- amd64
.respdiff: &respdiff
stage: respdiff
dependencies: []
......
#!/bin/bash
python3 -m flake8 --max-line-length=100 tests/pytests
FLAKE8=$?
ci/pytests/pylint-run.sh
PYLINT=$?
if [ $PYLINT -ne 0 ]; then
exit 1
fi
if [ $FLAKE8 -ne 0 ]; then
exit 1
fi
exit 0
#!/usr/bin/env bash
set -e
# Find Python modules and standalone Python scripts
FILES=$(find ./tests/pytests \
-type d -exec test -e '{}/__init__.py' \; -print -prune -o \
-name '*.py' -print)
python3 -m pylint -j 0 --rcfile ./tests/pytests/pylintrc ${FILES}
[MESSAGES CONTROL]
disable=
missing-docstring,
too-many-arguments,
too-many-instance-attributes,
fixme,
unused-import, # checked by flake8
line-too-long, # checked by flake8
invalid-name,
broad-except,
bad-continuation,
global-statement,
no-else-return,
redefined-outer-name, # commonly used with pytest fixtures
[SIMILARITIES]
min-similarity-lines=6
ignore-comments=yes
ignore-docstrings=yes
ignore-imports=no
[DESIGN]
max-parents=10
[TYPECHECK]
ignored-modules=ssl
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment