Skip to content

Instantly share code, notes, and snippets.

@aaronmelton
Last active November 25, 2023 14:16
Show Gist options
  • Save aaronmelton/385b69524588facbc948742d7f22c8fc to your computer and use it in GitHub Desktop.
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.
#!/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