-
-
Save thingsiplay/556d0b5a7933c3d202536203e317bfcd to your computer and use it in GitHub Desktop.
py - check Python script with mypy and flake8, then execute it
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
#!/bin/env bash | |
# py - check Python script with mypy and flake8, then execute it | |
export PATH=".:$PATH" | |
file=$(/usr/bin/which --skip-alias --skip-functions "$1") | |
shift | |
export MYPY_CACHE_DIR="/tmp/.mypy_cache" | |
mkdir -p "$MYPY_CACHE_DIR" | |
mypy "$file" \ | |
&& flake8 "$file" \ | |
&& python3 "$file" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment