Skip to content

Commit 7e3d460

Browse files
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 <[email protected]>
1 parent 294f16c commit 7e3d460

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/python-common/tox.ini

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = lint, rstcheck, mypy, py3
2+
envlist = lint, rstcheck, mypy, py3, check-black
33
skip_missing_interpreters = true
44

55
[testenv:py3]
@@ -36,3 +36,21 @@ deps =
3636
rstcheck
3737
commands =
3838
rstcheck --report-level info README.rst
39+
40+
41+
# OPT-IN formatting with 'black'
42+
# add your module to the modules list below to use automated formatting
43+
[black]
44+
deps = black>=23,<25
45+
options = -l78 -t py36 --skip-string-normalization
46+
modules = ceph/cephadm ceph/cryptotools ceph/fs ceph/utils.py
47+
48+
[testenv:check-black]
49+
deps = {[black]deps}
50+
commands =
51+
black --check -q {[black]options} {[black]modules}
52+
53+
[testenv:format-black]
54+
deps = {[black]deps}
55+
commands =
56+
black {[black]options} {[black]modules}

0 commit comments

Comments
 (0)