Skip to content

Commit a2083e1

Browse files
committed
tox: add format target for code formatting
And verify the formatting in the lint target as well. Fixes #14.
1 parent c63510d commit a2083e1

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tox.ini

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,24 @@ deps =
9595
cython-lint
9696
isort
9797
pylint
98+
black
9899
commands =
99100
bash -c "shopt -s extglob globstar nullglob; cython-lint --max-line-length 100 **/*.p{yx,xd}"
100101
# check for improperly formatted imports in non-generated files
101102
isort -l 100 -s pkgcraft_c.pxd --check-only --diff benches examples src tests setup.py
102103
# check for unused imports
103104
pylint --score=no --disable=all --enable=W0611 benches examples tests setup.py
105+
# verify formatting
106+
black -l 100 --check --include "benches|examples|tests|setup.py" .
107+
108+
[testenv:format]
109+
description = auto-format code using various procedures
110+
deps =
111+
isort
112+
black
113+
commands =
114+
isort -l 100 -s pkgcraft_c.pxd benches examples src tests setup.py
115+
black -l 100 --include "benches|examples|tests|setup.py" .
104116

105117
[testenv:sdist]
106118
description = build the source distribution

0 commit comments

Comments
 (0)