changeset 43347:abb95b6f79d3 stable

formatting: using black to check for formatting
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 29 Oct 2019 10:43:47 +0100
parents 6ada8a274b9c
children daa3b58906d5
files tests/hghave.py tests/test-check-format.t
diffstat 2 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/tests/hghave.py	Tue Oct 29 10:41:30 2019 +0100
+++ b/tests/hghave.py	Tue Oct 29 10:43:47 2019 +0100
@@ -980,12 +980,9 @@
     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)
--- a/tests/test-check-format.t	Tue Oct 29 10:41:30 2019 +0100
+++ b/tests/test-check-format.t	Tue Oct 29 10:43:47 2019 +0100
@@ -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'`