From 9e1f358f82e5639e04c5aa93307351407426d6d8 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Fri, 14 Feb 2020 15:09:52 +0100 Subject: [PATCH] Add `make stylediff` command and run it in tox (#3535) * Update Makefile * Update make.bat * Update tox.ini --- Makefile | 2 ++ make.bat | 4 ++++ tox.ini | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 89ff453ef..1a1e996d1 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ reformat: $(PYTHON) -m black `git ls-files "*.py"` stylecheck: $(PYTHON) -m black --check `git ls-files "*.py"` +stylediff: + $(PYTHON) -m black --check --diff `git ls-files "*.py"` # Translations gettext: diff --git a/make.bat b/make.bat index 5f880d235..a02c1391e 100644 --- a/make.bat +++ b/make.bat @@ -21,6 +21,10 @@ exit /B %ERRORLEVEL% black --check !PYFILES! exit /B %ERRORLEVEL% +:stylediff +black --check --diff !PYFILES! +exit /B %ERRORLEVEL% + :newenv py -3.8 -m venv --clear .venv .\.venv\Scripts\python -m pip install -U pip setuptools diff --git a/tox.ini b/tox.ini index d532c4727..4ceecff4c 100644 --- a/tox.ini +++ b/tox.ini @@ -65,4 +65,4 @@ setenv = basepython = python3.8 extras = style commands = - make stylecheck + make stylediff