mirror of
https://github.com/craigerl/aprsd.git
synced 2024-11-18 06:11:49 -05:00
Walter A. Boring IV
d1a50c6559
This patch adds support for tox. Tox is used to run various python compliance tests. This enables pep8 tests, as well as python2 and python3 compatibility as well as coverage and documentation building.
26 lines
586 B
Bash
Executable File
26 lines
586 B
Bash
Executable File
#!/bin/bash
|
|
|
|
NUM_COMMITS=${FAST8_NUM_COMMITS:-1}
|
|
|
|
if [[ $NUM_COMMITS = "smart" ]]; then
|
|
# Run on all commits not submitted yet
|
|
# (sort of -- only checks vs. "master" since this is easy)
|
|
NUM_COMMITS=$(git cherry master | wc -l)
|
|
fi
|
|
|
|
echo "Checking last $NUM_COMMITS commits."
|
|
|
|
cd $(dirname "$0")/..
|
|
CHANGED=$(git diff --name-only HEAD~${NUM_COMMITS} | tr '\n' ' ')
|
|
|
|
# Skip files that don't exist
|
|
# (have been git rm'd)
|
|
CHECK=""
|
|
for FILE in $CHANGED; do
|
|
if [ -f "$FILE" ]; then
|
|
CHECK="$CHECK $FILE"
|
|
fi
|
|
done
|
|
|
|
diff -u --from-file /dev/null $CHECK | flake8 --diff
|