Last active
November 25, 2023 14:16
-
-
Save aaronmelton/385b69524588facbc948742d7f22c8fc to your computer and use it in GitHub Desktop.
A simple shell script I use to scan my Python code for issues before committing code changes. Requires the use of pyproject.toml to work.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo '-->Running Flake8p' && \ | |
flake8p --config pyproject.toml . && \ | |
echo '-->Running Black' && \ | |
black --config pyproject.toml --check --diff . && \ | |
echo '-->Running isort' && \ | |
find . -name '*.py' -not -path '*/tests/*' | xargs isort --profile black --skip tests/ && \ | |
echo '-->Running Pylint' && \ | |
find . -name '*.py' | xargs pylint --rcfile=pyproject.toml && \ | |
echo '-->Running pydocstyle' && \ | |
pydocstyle . --config=pyproject.toml && \ | |
echo '-->Running Bandit' && \ | |
bandit --recursive ./ --configfile pyproject.toml && \ | |
echo '-->Running pytest' && \ | |
coverage run -m pytest --color=yes -vvv && \ | |
echo '-->Running coverage' && \ | |
coverage report |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment