diff --git a/dist/tools/backport_pr/setup.cfg b/dist/tools/backport_pr/setup.cfg new file mode 100644 index 0000000000..37171e2678 --- /dev/null +++ b/dist/tools/backport_pr/setup.cfg @@ -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 diff --git a/dist/tools/backport_pr/tox.ini b/dist/tools/backport_pr/tox.ini index c2a23359df..d8a018c971 100644 --- a/dist/tools/backport_pr/tox.ini +++ b/dist/tools/backport_pr/tox.ini @@ -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}