Mercurial > hg-stable
changeset 46787:decc3bd3f20d
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
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 01 Dec 2020 12:59:33 -0500 |
parents | d13afdd1f6e2 |
children | c94fa884240b |
files | black.toml contrib/examples/fix.hgrc pyproject.toml tests/test-check-code.t tests/test-check-format.t |
diffstat | 5 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- 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/**'`