Skip to content

Commit

Permalink
Merge pull request #1360 from AdeelH/yapf
Browse files Browse the repository at this point in the history
Update yapf to 0.23
  • Loading branch information
AdeelH committed Mar 18, 2022
2 parents 609b169 + 4aafa85 commit b589852
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ flake8==4.0.*
moto==3.0.6
coverage==5.5
codecov==2.1.12
yapf==0.22.*
yapf==0.23.*
unify==0.5
sphinx==4.0.*
sphinx-autobuild==2021.3.*
Expand Down
2 changes: 1 addition & 1 deletion scripts/format_code
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ else
find . -name '*.py' -print0 | xargs -0 $UNIFY

echo "Running yapf..."
yapf -ipr "$SRC_DIR" -e "**/conf.py" -e "**/setup.py" -e "**/cookiecutter_template/**" -e "*tfod_utils*"
yapf -ipr "$SRC_DIR" -e "*.git*" -e "*build*" -e "*cookiecutter_template*" -e "*tfod_utils*" -e "**/conf.py" -e "**/setup.py" -e "*.history*"
fi
4 changes: 1 addition & 3 deletions scripts/style_tests
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ else
# Exit code of 1 if yapf has a non-empty diff
# (ie. scripts/format_code needs to be run)
echo "Checking that code is consistent with yapf..."
if !(yapf -dpr -e "*cookiecutter_template*" -e "*tfod_utils*" -e "**/conf.py" -e "**/setup.py" "$SRC_DIR" > /dev/null &&
yapf -dpr "$SRC_DIR/tests" > /dev/null &&
yapf -dpr "$SRC_DIR/integration_tests" > /dev/null); then
if !(yapf -dpr -e "*.git*" -e "*build*" -e "*cookiecutter_template*" -e "*tfod_utils*" -e "**/conf.py" -e "**/setup.py" -e "*.history*" "$SRC_DIR" > /dev/null); then
echo "Code has not been formatted by yapf. Need to run ./scripts/format_code."
exit 1
fi
Expand Down

0 comments on commit b589852

Please sign in to comment.