From 5b309831ec595ad21c491c257c8ecf60f10c1ddd Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Mon, 6 May 2019 15:39:19 -0400 Subject: [PATCH] Set up pre-commit to run black Call it automatically via tox --- .pre-commit-config.yaml | 5 +++++ tox.ini | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..e6e23c87 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: + - repo: https://github.com/python/black + rev: 19.3b0 + hooks: + - id: black diff --git a/tox.ini b/tox.ini index d37d2486..22848681 100644 --- a/tox.ini +++ b/tox.ini @@ -37,6 +37,11 @@ commands = # pytest-cov doesn't seem to play nice with -p coverage run -p -m pytest tests examples +[testenv:stylecheck] +deps = pre-commit +skip_install = true +commands = pre-commit run --all-files --show-diff-on-failure + [testenv:docs-html] deps = -r docs/requirements.txt