You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
956 B
Bash

#!/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