From 933420961112fbdd2eae8b7a643fb6ef26e815c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20N=C3=A4slund?= Date: Fri, 18 Nov 2022 10:22:57 +0100 Subject: updated dev-run.sh --- dev-run.sh | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) (limited to 'dev-run.sh') diff --git a/dev-run.sh b/dev-run.sh index 7fb3699..51a4cbb 100755 --- a/dev-run.sh +++ b/dev-run.sh @@ -1,14 +1,43 @@ #!/bin/bash echo "Checking package" -mypy --strict --namespace-packages --ignore-missing-imports --cache-dir=/tmp/ src/soc_collector/*.py || exit 1 -black --line-length 120 src/soc_collector/*.py # || exit 1 -pylint --max-line-length 120 src/soc_collector/*.py # || exit 1 + +which mypy > /dev/null +if [ $? -eq 0 ] +then + mypy --strict --namespace-packages --ignore-missing-imports --cache-dir=/tmp/ src/soc_collector/*.py || exit 1 +fi + +which black > /dev/null +if [ $? -eq 0 ] +then + black --line-length 120 src/soc_collector/*.py # || exit 1 +fi + +which pylint > /dev/null +if [ $? -eq 0 ] +then + pylint --max-line-length 120 src/soc_collector/*.py # || exit 1 +fi echo "Checking tests" -mypy --strict --namespace-packages --ignore-missing-imports --cache-dir=/tmp/ tests/*.py # || exit 1 -black --line-length 120 tests/*.py # || exit 1 -pylint --disable R0801 --max-line-length 120 tests/*.py # || exit 1 +which mypy > /dev/null +if [ $? -eq 0 ] +then + mypy --strict --namespace-packages --ignore-missing-imports --cache-dir=/tmp/ tests/*.py || exit 1 +fi + +which black > /dev/null +if [ $? -eq 0 ] +then + black --line-length 120 tests/*.py # || exit 1 +fi + +which pylint > /dev/null +if [ $? -eq 0 ] +then + pylint --max-line-length 120 tests/*.py # || exit 1 +fi # Stop the containers docker-compose down --remove-orphans -- cgit v1.1