Skip to content

Commit

Permalink
Run black on all files if the git diff command fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Hennenfent committed Aug 26, 2020
1 parent c26f291 commit 905cd6c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ jobs:
git fetch --depth=1 origin $BASE_SHA
echo "Files Changed:"
git diff --name-only $BASE_SHA... | tee .diff_names.txt
cat .diff_names.txt | python scripts/pyfile_exists.py | xargs black --diff --check
NAMES=$(cat .diff_names.txt | python scripts/pyfile_exists.py)
if test -z $NAMES
then
black --diff --check .
else
echo $NAMES | xargs black --diff --check
fi
mypy --version
mypy
tests:
Expand Down

0 comments on commit 905cd6c

Please sign in to comment.