1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tools/backport_pr: add black testenv in tox

Add Flake8 and Pylint configuration compatible with black
This commit is contained in:
Alexandre Abadie 2021-09-28 15:09:58 +02:00
parent e86370cf4b
commit 43a7c8c8f2
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 20 additions and 2 deletions

12
dist/tools/backport_pr/setup.cfg vendored Normal file
View File

@ -0,0 +1,12 @@
# Use black compatible configuration for flake8 and pylint
# flake8: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
# pylint: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#pylint
[flake8]
max-line-length = 88
extend-ignore = E203
[pylint]
max-line-length = 88
[pylint.messages_control]
disable = C0330, C0326

View File

@ -1,5 +1,5 @@
[tox]
envlist = test,lint,flake8
envlist = test,lint,flake8,black
skipsdist = True
[testenv]
@ -11,6 +11,7 @@ commands =
test: {[testenv:test]commands}
lint: {[testenv:lint]commands}
flake8: {[testenv:flake8]commands}
black: {[testenv:black]commands}
[testenv:test]
deps =
@ -25,10 +26,15 @@ deps =
{[testenv]deps}
commands =
# Suppress warning about TODO in code
pylint --disable=fixme {env:script}
pylint --rcfile=setup.cfg --disable=fixme {env:script}
[testenv:flake8]
deps = flake8
commands =
# main() is quite complex, provide enough margin
flake8 --max-complexity=25 {env:script}
[testenv:black]
deps = black
commands =
black --check --diff {env:script}