summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--Makefile7
-rw-r--r--pyproject.toml3
-rw-r--r--tox.ini9
4 files changed, 18 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml
index 989cff9..e729b8d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,6 +18,8 @@ matrix:
env: TOXENV=py37
- python: 3.8-dev
env: TOXENV=py38
+ - python: 3.7
+ env: TOXENV=black
- python: 2.7
env: TOXENV=pep8py2
- python: 3.7
diff --git a/Makefile b/Makefile
index c5f6ced..83e5dc8 100644
--- a/Makefile
+++ b/Makefile
@@ -5,9 +5,9 @@ INSTALLFLAGS=
PYTHONS=python2.6 python2.7 python3.1 python3.2 python3.3 python3.4
.PHONY: inplace all rebuild test_inplace test fulltests clean distclean
-.PHONY: sdist install
+.PHONY: sdist install black
-all: inplace README.html README.md
+all: inplace black README.html README.md
README.md: README.txt CHANGES.txt
pandoc --from=rst --to=gfm README.txt > $@
@@ -28,6 +28,9 @@ test_inplace: inplace
test: test_inplace
+black:
+ black $(CURDIR) || true
+
fulltest:
$(MAKE) clean
@set -e; \
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..22e0c45
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,3 @@
+[tool.black]
+line-length = 98
+target-version = ['py27', 'py35', 'py36', 'py37', 'py38']
diff --git a/tox.ini b/tox.ini
index e665374..1920c59 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py27,py35,py36,py37,py38,pep8py2,pep8py3,doc
+envlist = py27,py35,py36,py37,py38,black,pep8py2,pep8py3,doc
skip_missing_interpreters = true
[testenv]
@@ -14,6 +14,13 @@ commands =
# lxml FTBFS because Python sets -Wimplicit-int
deps =
+[testenv:black]
+commands = black --check --verbose \
+ {toxinidir}/setup.py \
+ {toxinidir}/tests.py \
+ {toxinidir}/defusedxml/
+deps = black
+
[testenv:pep8py2]
basepython = python2.7
deps =