Skip to content
Snippets Groups Projects
Commit 51c58ac2 authored by Simon McVittie's avatar Simon McVittie
Browse files

Add some basic Python quality checking infrastructure

parent 4d755e5f
No related branches found
No related tags found
No related merge requests found
check:
prove -v t/*.sh
#!/bin/sh
# Copyright © 2016-2018 Simon McVittie
# Copyright © 2018 Collabora Ltd.
#
# SPDX-License-Identifier: MIT
set -e
set -u
export MYPYPATH="${PYTHONPATH:=$(pwd)}"
i=0
for script in \
*.py \
; do
i=$((i + 1))
if [ "x${MYPY:="$(command -v mypy || echo false)"}" = xfalse ]; then
echo "ok $i - $script # SKIP mypy not found"
elif "${MYPY}" \
--python-executable="${PYTHON:=python3}" \
--follow-imports=skip \
--ignore-missing-imports \
$script; then
echo "ok $i - $script"
else
echo "not ok $i - $script # TODO mypy issues reported"
fi
done
echo "1..$i"
# vim:set sw=4 sts=4 et:
#!/bin/sh
# Copyright © 2016-2018 Simon McVittie
# Copyright © 2018 Collabora Ltd.
#
# SPDX-License-Identifier: MIT
set -e
set -u
if [ "x${PYCODESTYLE:=pycodestyle}" = xfalse ] || \
[ -z "$(command -v "$PYCODESTYLE")" ]; then
echo "1..0 # SKIP pycodestyle not found"
elif "${PYCODESTYLE}" \
*.py \
>&2; then
echo "1..1"
echo "ok 1 - $PYCODESTYLE reported no issues"
else
echo "1..1"
echo "not ok 1 # TODO $PYCODESTYLE issues reported"
fi
# vim:set sw=4 sts=4 et:
#!/bin/sh
# Copyright © 2016-2018 Simon McVittie
# Copyright © 2018 Collabora Ltd.
#
# SPDX-License-Identifier: MIT
set -e
set -u
if [ "x${PYFLAKES:=pyflakes3}" = xfalse ] || \
[ -z "$(command -v "$PYFLAKES")" ]; then
echo "1..0 # SKIP pyflakes3 not found"
elif "${PYFLAKES}" \
*.py \
>&2; then
echo "1..1"
echo "ok 1 - $PYFLAKES reported no issues"
else
echo "1..1"
echo "not ok 1 # TODO $PYFLAKES issues reported"
fi
# vim:set sw=4 sts=4 et:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment