black: merge config into main pyproject.toml now that we have it
authorAugie Fackler <augie@google.com>
Tue, 01 Dec 2020 12:59:33 -0500
changeset 46454 d4c8b4b90ecb
parent 46453 45afff0f530a
child 46455 374d7fff7cb5
black: merge config into main pyproject.toml now that we have it This means that naive contributors who just run `black` on a source file will get reasonable behavior as long as they have a recent black. Yay! Differential Revision: https://phab.mercurial-scm.org/D9834
black.toml
contrib/examples/fix.hgrc
pyproject.toml
tests/test-check-code.t
tests/test-check-format.t
--- a/black.toml	Tue Dec 01 12:52:04 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-[tool.black]
-line-length = 80
-exclude = '''
-build/
-| wheelhouse/
-| dist/
-| packages/
-| \.hg/
-| \.mypy_cache/
-| \.venv/
-| mercurial/thirdparty/
-'''
-skip-string-normalization = true
-quiet = true
--- a/contrib/examples/fix.hgrc	Tue Dec 01 12:52:04 2020 -0500
+++ b/contrib/examples/fix.hgrc	Tue Dec 01 12:59:33 2020 -0500
@@ -5,7 +5,7 @@
 rustfmt:command = rustfmt +nightly
 rustfmt:pattern = set:"**.rs" - "mercurial/thirdparty/**"
 
-black:command = black --config=black.toml -
+black:command = black
 black:pattern = set:**.py - mercurial/thirdparty/**
 
 # Mercurial doesn't have any Go code, but if we did this is how we
--- a/pyproject.toml	Tue Dec 01 12:52:04 2020 -0500
+++ b/pyproject.toml	Tue Dec 01 12:59:33 2020 -0500
@@ -1,3 +1,18 @@
 [build-system]
 requires = ["setuptools", "wheel"]
 build-backend = "setuptools.build_meta"
+
+[tool.black]
+line-length = 80
+exclude = '''
+build/
+| wheelhouse/
+| dist/
+| packages/
+| \.hg/
+| \.mypy_cache/
+| \.venv/
+| mercurial/thirdparty/
+'''
+skip-string-normalization = true
+quiet = true
--- a/tests/test-check-code.t	Tue Dec 01 12:52:04 2020 -0500
+++ b/tests/test-check-code.t	Tue Dec 01 12:59:33 2020 -0500
@@ -66,7 +66,6 @@
   COPYING
   Makefile
   README.rst
-  black.toml
   hg
   hgeditor
   hgweb.cgi
--- a/tests/test-check-format.t	Tue Dec 01 12:52:04 2020 -0500
+++ b/tests/test-check-format.t	Tue Dec 01 12:59:33 2020 -0500
@@ -1,5 +1,5 @@
 #require black test-repo
 
   $ cd $RUNTESTDIR/..
-  $ black --config=black.toml --check --diff `hg files 'set:(**.py + grep("^#!.*python")) - mercurial/thirdparty/**'`
+  $ black --check --diff `hg files 'set:(**.py + grep("^#!.*python")) - mercurial/thirdparty/**'`