Patchwork D7447: tests: verify that Python scripts are blackened

login
register
mail settings
Submitter phabricator
Date Nov. 16, 2019, 8:09 p.m.
Message ID <differential-rev-PHID-DREV-ezac3mszrehnn65i7b63-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43315/
State Superseded
Headers show

Comments

phabricator - Nov. 16, 2019, 8:09 p.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Scripts are Python too. They should be blackened.
  
  (As suggested by Pierre-Yves in D7420 <https://phab.mercurial-scm.org/D7420>.)

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D7447

AFFECTED FILES
  tests/test-check-format.t
  tests/test-check-shbang.t

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-check-shbang.t b/tests/test-check-shbang.t
--- a/tests/test-check-shbang.t
+++ b/tests/test-check-shbang.t
@@ -11,6 +11,7 @@ 
 In tests, enforce $PYTHON and *not* /usr/bin/env python or similar:
   $ testrepohg files 'set:grep(r"#!.*?python") and **/*.t' \
   > -X tests/test-check-execute.t \
+  > -X tests/test-check-format.t \
   > -X tests/test-check-module-imports.t \
   > -X tests/test-check-pyflakes.t \
   > -X tests/test-check-shbang.t
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,5 +1,5 @@ 
 #require black
 
   $ cd $RUNTESTDIR/..
-  $ black --config=black.toml --check --diff `hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"'`
+  $ black --config=black.toml --check --diff `hg files 'set:(**.py + grep("^#!.*python")) - mercurial/thirdparty/** - "contrib/python-zstandard/**"'`