Add/update dev scripts and Github workflow

This commit is contained in:
2023-06-24 17:10:24 +02:00
parent f5b31b7580
commit 21eb0c065d
7 changed files with 106 additions and 26 deletions
+13 -12
View File
@@ -1,16 +1,17 @@
#!/usr/bin/env bash
# Runs type checker and linters.
# Runs various linters.
# Ensure that we return to the current working directory
# and exit the script immediately in case of an error:
trap "cd $(realpath ${PWD}); exit 1" ERR
# Change into project root directory:
cd "$(dirname $(dirname $(realpath $0)))"
echo 'Performing type checks...'
mypy
echo
source "$(dirname $(realpath $0))/util.sh"
echo 'Linting source and test files...'
flake8 src/ tests/
echo -e 'No issues found.'
echo ' isort - consistent imports'
isort src/ tests/ --check-only
echo ' ruff - extensive linting'
ruff src/ tests/
echo ' black - consistent style'
run_and_capture black src/ tests/ --check
echo -e "${bold_green}No issues found${color_reset}\n"