GBA003/External/Harmony/Backends/Dropbox/Carthage/Checkouts/SwiftyDropbox/stone/mypy-run.sh
2024-05-30 10:22:15 +08:00

10 lines
300 B
Bash
Executable File

#!/bin/bash -eux
EXCLUDE='(^example/|^ez_setup\.py$|^setup\.py$)'
# Include all Python files registered in Git, that don't occur in $EXCLUDE.
INCLUDE=$(git ls-files "$@" | grep '\.py$' | grep -Ev "$EXCLUDE" | tr '\n' '\0' | xargs -0 | cat)
MYPY_CMD=mypy
$MYPY_CMD $INCLUDE
$MYPY_CMD --py2 $INCLUDE