-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FW-573: Added backoff decorators (#14)
* Added backoff decorators
- Loading branch information
1 parent
480c57b
commit 3253961
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/sh | ||
# | ||
# An example hook script to verify what is about to be committed. | ||
# Called by "git commit" with no arguments. The hook should | ||
# exit with non-zero status after issuing an appropriate message if | ||
# it wants to stop the commit. | ||
# | ||
# To enable this hook, rename this file to "pre-commit". | ||
|
||
if git rev-parse --verify HEAD >/dev/null 2>&1 | ||
then | ||
against=HEAD | ||
else | ||
# Initial commit: diff against an empty tree object | ||
against=$(git hash-object -t tree /dev/null) | ||
fi | ||
|
||
|
||
# Redirect output to stderr. | ||
exec 1>&2 | ||
|
||
RED='\033[0;31m' | ||
NC='\033[0m' # No Color | ||
format_err=0 | ||
check_err=0 | ||
err=0 | ||
|
||
echo 'Running "ruff format --check"' | ||
ruff format --check | ||
|
||
if [ "$?" -eq 1 ]; then | ||
format_err=1 | ||
err=1 | ||
fi | ||
|
||
echo 'Running "ruff check"' | ||
ruff check | ||
|
||
if [ "$?" -eq 1 ]; then | ||
check_err=1 | ||
err=1 | ||
fi | ||
|
||
if [ "${format_err}" -eq 1 ] ; then | ||
echo "${RED}Run \"ruff format\" before committing${NC}" | ||
fi | ||
|
||
if [ "${check_err}" -eq 1 ] ; then | ||
echo "${RED}Correct ruff errors before committing${NC}" | ||
fi | ||
|
||
if [ "${err}" -eq 1 ] ; then | ||
exit 1 | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.*/* | ||
!.githooks/* | ||
**/__pycache__/* | ||
*.docx | ||
build/* | ||
|
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