From 8231d487797497c618b97421ed61fd7d8679e135 Mon Sep 17 00:00:00 2001 From: Robert Gieseke Date: Wed, 22 May 2019 14:55:53 +0200 Subject: [PATCH] Paint it black --- Makefile | 10 +++++++++- tests/test_pyhector.py | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 425b1cd..2790c66 100644 --- a/Makefile +++ b/Makefile @@ -64,4 +64,12 @@ test-testpypi-install: # Remove local directory from path to get actual installed version. $(TEMPVENV)/bin/python -c "import sys; sys.path.remove(''); import pyhector; print(pyhector.__version__)" -.PHONY: watchdocs write_defaults write_constants plot_example publish-on-pypi test-pypi-install publish-on-testpypi test-testpypi-install +black: venv + @status=$$(git status --porcelain pyhector tests); \ + if test "x$${status}" = x; then \ + ./venv/bin/black --exclude _version.py setup.py pyhector tests; \ + else \ + echo Not trying any formatting. Working directory is dirty ... >&2; \ + fi; + +.PHONY: watchdocs write_defaults write_constants plot_example publish-on-pypi test-pypi-install publish-on-testpypi test-testpypi-install black diff --git a/tests/test_pyhector.py b/tests/test_pyhector.py index 348833e..20f46a8 100644 --- a/tests/test_pyhector.py +++ b/tests/test_pyhector.py @@ -178,4 +178,6 @@ def test_hector_version(): if "+" in pyhector.__version__: pass else: - assert ".".join(pyhector.__version__.split(".")[:3]) == pyhector.__hector_version__ + assert ( + ".".join(pyhector.__version__.split(".")[:3]) == pyhector.__hector_version__ + )