# HG changeset patch # User Augie Fackler # Date 1606845573 18000 # Node ID d4c8b4b90ecb9df37b64569f89a8921c1083ac54 # Parent 45afff0f530a48b232a655ecd1af3978cef25b11 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 diff -r 45afff0f530a -r d4c8b4b90ecb black.toml --- 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 diff -r 45afff0f530a -r d4c8b4b90ecb contrib/examples/fix.hgrc --- 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 diff -r 45afff0f530a -r d4c8b4b90ecb pyproject.toml --- 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 diff -r 45afff0f530a -r d4c8b4b90ecb tests/test-check-code.t --- 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 diff -r 45afff0f530a -r d4c8b4b90ecb tests/test-check-format.t --- 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/**'`