Patchwork [2,of,3,STABLE] formatting: using black to check for formatting

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 29, 2019, 11:08 a.m.
Message ID <0e9acc6539a0d23b2a74.1572347337@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/42610/
State Accepted
Headers show

Comments

Pierre-Yves David - Oct. 29, 2019, 11:08 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1572342227 -3600
#      Tue Oct 29 10:43:47 2019 +0100
# Branch stable
# Node ID 0e9acc6539a0d23b2a7428ad86cc4fa79e47d7a5
# Parent  86e3e803a4e6cac0b503afd63bad3f4f43ff7e5a
# EXP-Topic switch-to-black
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 0e9acc6539a0
formatting: using black to check for formatting

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -980,12 +980,9 @@  def has_emacs():
     return matchoutput('emacs --version', b'GNU Emacs 2(4.4|4.5|5|6|7|8|9)')
 
 
-# @check('black', 'the black formatter for python')
-@check('grey', 'grey, the fork of the black formatter for python')
+@check('black', 'the black formatter for python')
 def has_black():
     # use that to actual black as soon as possible
-    # blackcmd = 'black --version'
-    blackcmd = 'python3 $RUNTESTDIR/../contrib/grey.py --version'
-    # version_regex = b'black, version \d'
-    version_regex = b'grey.py, version \d'
+    blackcmd = 'black --version'
+    version_regex = b'black, version \d'
     return matchoutput(blackcmd, version_regex)
diff --git a/tests/test-check-format.t b/tests/test-check-format.t
--- a/tests/test-check-format.t
+++ b/tests/test-check-format.t
@@ -1,7 +1,5 @@ 
-#require grey
-
-(this should use the actual black as soon as possible)
+#require black
 
   $ cd $RUNTESTDIR/..
-  $ python3 contrib/grey.py --config=black.toml --check --diff `hg files 'set:**.py - hgext/fsmonitor/pywatchman/** - mercurial/thirdparty/** - "contrib/python-zstandard/**" - contrib/grey.py'`
+  $ black --config=black.toml --check --diff `hg files 'set:**.py - hgext/fsmonitor/pywatchman/** - mercurial/thirdparty/** - "contrib/python-zstandard/**" - contrib/grey.py'`