summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Näslund <victor@sunet.se>2022-11-18 10:22:57 +0100
committerVictor Näslund <victor@sunet.se>2022-11-18 10:22:57 +0100
commit933420961112fbdd2eae8b7a643fb6ef26e815c4 (patch)
treec6126ab9523e0082353271aacf8ef98f68cdc751
parent1918d46fd6ba57cc9790e75d235c188f285678c9 (diff)
updated dev-run.sh
-rwxr-xr-xdev-run.sh41
1 files changed, 35 insertions, 6 deletions
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