Screw git hooks

This commit is contained in:
Markus Unterwaditzer 2018-01-05 18:24:14 +01:00
parent afa8031eec
commit f1310883b9
2 changed files with 3 additions and 10 deletions

View file

@ -81,7 +81,7 @@ install-test: install-servers
[ -z "$(TEST_EXTRA_PACKAGES)" ] || pip install $(TEST_EXTRA_PACKAGES)
install-style: install-docs
pip install flake8 flake8-import-order 'flake8-bugbear>=17.3.0' autopep8
pip install flake8 flake8-import-order 'flake8-bugbear>=17.3.0'
style:
flake8
@ -123,13 +123,6 @@ install-dev:
pip install -U --force-reinstall $$(python setup.py --quiet minimal_requirements); \
fi
install-git-hooks: install-style
echo "make style-autocorrect" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
style-autocorrect:
git diff --cached --name-only | egrep '\.py$$' | xargs --no-run-if-empty autopep8 -ri
ssh-submodule-urls:
git submodule foreach "\
echo -n 'Old: '; \

View file

@ -129,9 +129,9 @@ def sync(storage_a, storage_b, status, conflict_resolution=None,
raise BothReadOnly()
if conflict_resolution == 'a wins':
def conflict_resolution(a, b): return a
conflict_resolution = lambda a, b: a
elif conflict_resolution == 'b wins':
def conflict_resolution(a, b): return b
conflict_resolution = lambda a, b: b
status_nonempty = bool(next(status.iter_old(), None))