summaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
authorChandan Singh <csingh43@bloomberg.net>2019-11-05 12:59:51 +0000
committerChandan Singh <chandan@chandansingh.net>2019-11-14 21:18:52 +0000
commite7d7c1f4b76e112ed7e5d32cf4e053fb69cbc121 (patch)
tree10bd69aeab6cbe67ed302be60043f1d909c85c95 /tox.ini
parent10a5b9ffdea2977d01edd28e9a21c3bb0ecb0e12 (diff)
downloadbuildstream-e7d7c1f4b76e112ed7e5d32cf4e053fb69cbc121.tar.gz
Add configuration to run Black
Introduce two new tox environments - `format` and `format-check`. The `format` environment will reformat the code using `black` whereas the `format-check` envrionment will simply print the diff without modifying any files. Configure Black to use the same line lengths that we use currently, i.e. 119.
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini20
1 files changed, 20 insertions, 0 deletions
diff --git a/tox.ini b/tox.ini
index 4c18f2c14..d8fa3e984 100644
--- a/tox.ini
+++ b/tox.ini
@@ -103,6 +103,26 @@ setenv =
COVERAGE_FILE = {toxinidir}/.coverage-reports/.coverage
#
+# Code formatters
+#
+[testenv:format]
+skip_install = True
+deps =
+ black==19.10b0
+commands =
+ black {posargs: src tests}
+
+#
+# Code format checkers
+#
+[testenv:format-check]
+skip_install = True
+deps =
+ black==19.10b0
+commands =
+ black --check --diff {posargs: src tests}
+
+#
# Running linters
#
[testenv:lint]