-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
147 additions
and
164 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,5 @@ | ||
[flake8] | ||
ignore = E501,W503,E203,E731 | ||
max-line-length = 110 | ||
select = C,E,F,W,B,B950 | ||
exclude = .eggs/*,docs/*,lib,src,bin,include,share |
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,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Runs all executable pre-commit-* hooks and exits after, | ||
# if any of them was not successful. | ||
# | ||
# Based on | ||
# https://github.com/ELLIOTTCABLE/Paws.js/blob/Master/Scripts/git-hooks/chain-hooks.sh | ||
# http://osdir.com/ml/git/2009-01/msg00308.html | ||
# | ||
# assumes your scripts are located at <repo-root>/bin/git/hooks | ||
exitcodes=() | ||
hookname=`basename $0` | ||
# our special hooks folder | ||
CUSTOM_HOOKS_DIR=$(git rev-parse --show-toplevel)/dotgit/hooks | ||
# find gits native hooks folder | ||
NATIVE_HOOKS_DIR=$(git rev-parse --show-toplevel)/.git/hooks | ||
|
||
# Run each hook, passing through STDIN and storing the exit code. | ||
# We don't want to bail at the first failure, as the user might | ||
# then bypass the hooks without knowing about additional issues. | ||
|
||
for hook in $CUSTOM_HOOKS_DIR/$(basename $0)-*; do | ||
test -x "$hook" || continue | ||
$hook "$@" | ||
exitcodes+=($?) | ||
done | ||
|
||
# check if there was a local hook that was moved previously | ||
if [ -f "$NATIVE_HOOKS_DIR/$hookname.local" ]; then | ||
out=`$NATIVE_HOOKS_DIR/$hookname.local "$@"` | ||
exitcodes+=($?) | ||
echo "$out" | ||
fi | ||
|
||
# If any exit code isn't 0, bail. | ||
for i in "${exitcodes[@]}"; do | ||
[ "$i" == 0 ] || exit $i | ||
done |
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,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if ! black . --check -q; then | ||
black . | ||
echo "some files were not formatted correctly (black) commit aborted!" | ||
echo "your changes are still staged, you can accept formatting changes with git add or ignore them by adding --no-verify to git commit" | ||
exit 1 | ||
fi | ||
|
||
flake8 | ||
|
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,18 @@ | ||
#!/usr/bin/env bash | ||
# based on http://stackoverflow.com/a/3464399/1383268 | ||
# assumes that the hooks-wrapper script is located at <repo-root>/bin/git/hooks-wrapper | ||
|
||
HOOK_NAMES="applypatch-msg pre-applypatch post-applypatch pre-commit prepare-commit-msg commit-msg post-commit pre-rebase post-checkout post-merge pre-receive update post-receive post-update pre-auto-gc pre-push" | ||
# find gits native hooks folder | ||
HOOKS_DIR=$(git rev-parse --show-toplevel)/.git/hooks | ||
|
||
for hook in $HOOK_NAMES; do | ||
# If the hook already exists, is a file, and is not a symlink | ||
if [ ! -h $HOOKS_DIR/$hook ] && [ -f $HOOKS_DIR/$hook ]; then | ||
mv $HOOKS_DIR/$hook $HOOKS_DIR/$hook.local | ||
fi | ||
# create the symlink, overwriting the file if it exists | ||
# probably the only way this would happen is if you're using an old version of git | ||
# -- back when the sample hooks were not executable, instead of being named ____.sample | ||
ln -s -f ../../dotgit/hooks-wrapper $HOOKS_DIR/$hook | ||
done |
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
[tool.black] | ||
line-length = 88 | ||
py36 = true | ||
include = '\.pyi?$' | ||
exclude = ''' | ||
/( | ||
\.git | ||
| \.hg | ||
| \.egg | ||
| \.eggs | ||
| \.mypy_cache | ||
| \.tox | ||
| _build | ||
| \.venv | ||
| src | ||
| bin | ||
| stream_python\.egg-info | ||
| fabfile.py | ||
| lib | ||
| docs | ||
| buck-out | ||
| build | ||
| dist | ||
)/ | ||
''' |
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
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
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
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
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
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 +0,0 @@ | ||
from .test_client import * | ||
Oops, something went wrong.