From f20fd33d6fccc9fd32baa4e481d69a63a41a77af Mon Sep 17 00:00:00 2001
From: vtexier <vit@free.fr>
Date: Sat, 8 Jun 2019 09:37:06 +0200
Subject: [PATCH] [enh] #54 rename "black" command and stage to "format"

Add check-format command to Makefile
Fix format command to check only in gitlab-ci
---
 .gitlab-ci.yml |  8 ++++----
 Makefile       | 10 +++++++---
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9408d80b..e294c620 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,6 @@
 stages:
   - prepare
-  - black
+  - format
   - test
   - build
   - release
@@ -48,14 +48,14 @@ push_to_github:
       - setup.py
       - tests/**/*.py
 
-black:
+format:
   <<: *pyenv
   <<: *changes
-  stage: black
+  stage: format
   script:
     - pyenv shell 3.6.4  # black install and run needs python 3.6.x minimum
     - pip install -r requirements_dev.txt
-    - make black
+    - make check-format
 
 test:
   <<: *pyenv
diff --git a/Makefile b/Makefile
index d83c7c95..c494add8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: docs tests check mypy pylint black
+.PHONY: docs tests check check-format mypy pylint format
 
 # generate documentation
 docs:
@@ -9,7 +9,7 @@ tests:
 	python3 -m unittest ${TESTS_FILTER}
 
 # check
-check: mypy pylint black
+check: mypy pylint check-format
 
 # check static typing
 mypy:
@@ -19,6 +19,10 @@ mypy:
 pylint:
 	pylint --disable=C,R0913,R0903,R0902,R0914,R0912,R0915,W0613 --enable=C0121,C0202,C0321 --jobs=0 duniterpy/
 
+# check format
+check-format:
+	black --check duniterpy
+
 # format code
-black:
+format:
 	black duniterpy
-- 
GitLab