Add a simple repo-checking tool
It is superset of tests, testing repository itself, not only the code.master
parent
570f3d0426
commit
42e1c32bd6
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# SPDX-FileCopyrightText: 2022 LEdoian <checklib@pokemon.ledoian.cz>
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
|
# This is a simple script to check correctness/compliance of the repository as
|
||||||
|
# a whole. This is different from tests (test.py), which deal only with
|
||||||
|
# corectness of the code. This also checks the code using other tools, which do
|
||||||
|
# not directly impact the code, but try to minimize technical debt.
|
||||||
|
|
||||||
|
# I know that there are more sophisticated tools. This seemed sufficient and
|
||||||
|
# lightweight enough, so I didn't look further. You can try to convince me
|
||||||
|
# otherwise, please write me an email.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
red() {
|
||||||
|
tput setaf 1
|
||||||
|
echo "$@"
|
||||||
|
tput sgr0
|
||||||
|
}
|
||||||
|
|
||||||
|
has_reuse=$(type reuse >/dev/null 2>&1 && echo true || echo false)
|
||||||
|
if $has_reuse; then
|
||||||
|
reuse lint
|
||||||
|
else
|
||||||
|
red "REUSE tool not found, skipping"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
has_mypy=$(type mypy >/dev/null 2>&1 && echo true || echo false)
|
||||||
|
if $has_mypy; then
|
||||||
|
mypy *.py
|
||||||
|
else
|
||||||
|
red "Mypy not found, skipping"
|
||||||
|
fi
|
||||||
|
|
||||||
|
./test.py
|
Loading…
Reference in New Issue