]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common/tox.ini: enable black formatting 65155/head
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 20 Aug 2025 14:35:38 +0000 (10:35 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Mon, 15 Sep 2025 14:44:43 +0000 (10:44 -0400)
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 <jmulligan@redhat.com>
src/python-common/tox.ini

index e0b59c700ca3eb6bc8df6529b9d1edc461994646..0bcddea887baed257c8ecd282acc9461a19f0b00 100644 (file)
@@ -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}