From 7e3d4601550d9aebd93f47c6604546eb2402cafe Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 20 Aug 2025 10:35:38 -0400 Subject: [PATCH] python-common/tox.ini: enable black formatting Initially this is only for a few smaller packages/files that I don't need to wrestle with to make it work with black. Signed-off-by: John Mulligan --- src/python-common/tox.ini | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/python-common/tox.ini b/src/python-common/tox.ini index e0b59c700ca3e..0bcddea887bae 100644 --- a/src/python-common/tox.ini +++ b/src/python-common/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = lint, rstcheck, mypy, py3 +envlist = lint, rstcheck, mypy, py3, check-black skip_missing_interpreters = true [testenv:py3] @@ -36,3 +36,21 @@ deps = rstcheck commands = rstcheck --report-level info README.rst + + +# OPT-IN formatting with 'black' +# add your module to the modules list below to use automated formatting +[black] +deps = black>=23,<25 +options = -l78 -t py36 --skip-string-normalization +modules = ceph/cephadm ceph/cryptotools ceph/fs ceph/utils.py + +[testenv:check-black] +deps = {[black]deps} +commands = + black --check -q {[black]options} {[black]modules} + +[testenv:format-black] +deps = {[black]deps} +commands = + black {[black]options} {[black]modules} -- 2.39.5