diff options
author | Victor Näslund <victor@sunet.se> | 2022-11-18 10:22:57 +0100 |
---|---|---|
committer | Victor Näslund <victor@sunet.se> | 2022-11-18 10:22:57 +0100 |
commit | 933420961112fbdd2eae8b7a643fb6ef26e815c4 (patch) | |
tree | c6126ab9523e0082353271aacf8ef98f68cdc751 | |
parent | 1918d46fd6ba57cc9790e75d235c188f285678c9 (diff) |
updated dev-run.sh
-rwxr-xr-x | dev-run.sh | 41 |
1 files changed, 35 insertions, 6 deletions
@@ -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 |