# HG changeset patch # User Augie Fackler # Date 1606845573 18000 # Node ID decc3bd3f20d5628a0dd6c49394c00e51d1abe60 # Parent d13afdd1f6e25282f68a62c6ffa7b407a4ab2fec 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! This was previously D9834 but was rolled back due to test failures. nbjoerg thinks it's time to try again, so let's give it a shot. Differential Revision: https://phab.mercurial-scm.org/D10185 diff -r d13afdd1f6e2 -r decc3bd3f20d 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 d13afdd1f6e2 -r decc3bd3f20d 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 d13afdd1f6e2 -r decc3bd3f20d 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 d13afdd1f6e2 -r decc3bd3f20d 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 d13afdd1f6e2 -r decc3bd3f20d 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/**'`