From c98fc635fcf1b7d9a668df9614faa03c56b261d1 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 28 Sep 2021 14:58:30 +0200 Subject: [PATCH] tools/compile_and_test_for_board: add black testenv in tox Add Flake8 and Pylint configuration compatible with black --- dist/tools/compile_and_test_for_board/setup.cfg | 12 ++++++++++++ dist/tools/compile_and_test_for_board/tox.ini | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 dist/tools/compile_and_test_for_board/setup.cfg diff --git a/dist/tools/compile_and_test_for_board/setup.cfg b/dist/tools/compile_and_test_for_board/setup.cfg new file mode 100644 index 0000000000..37171e2678 --- /dev/null +++ b/dist/tools/compile_and_test_for_board/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/compile_and_test_for_board/tox.ini b/dist/tools/compile_and_test_for_board/tox.ini index e55c7252e5..dcc6cf7867 100644 --- a/dist/tools/compile_and_test_for_board/tox.ini +++ b/dist/tools/compile_and_test_for_board/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = test,lint,flake8 +envlist = test,lint,flake8,black skipsdist = True [testenv] @@ -10,6 +10,7 @@ commands = test: {[testenv:test]commands} lint: {[testenv:lint]commands} flake8: {[testenv:flake8]commands} + black: {[testenv:black]commands} [testenv:test] deps = pytest @@ -19,9 +20,14 @@ commands = [testenv:lint] deps = pylint commands = - pylint {env:script} tests + pylint --rcfile=setup.cfg {env:script} tests [testenv:flake8] deps = flake8 commands = flake8 {env:script} tests + +[testenv:black] +deps = black +commands = + black --check --diff {env:script} tests