diff options
author | Chandan Singh <csingh43@bloomberg.net> | 2019-11-05 12:59:51 +0000 |
---|---|---|
committer | Chandan Singh <chandan@chandansingh.net> | 2019-11-14 21:18:52 +0000 |
commit | e7d7c1f4b76e112ed7e5d32cf4e053fb69cbc121 (patch) | |
tree | 10bd69aeab6cbe67ed302be60043f1d909c85c95 /tox.ini | |
parent | 10a5b9ffdea2977d01edd28e9a21c3bb0ecb0e12 (diff) | |
download | buildstream-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.ini | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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] |