diff options
Diffstat (limited to '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 |