From 6d1eec57157bf90a869e2f7ebf213e70d0bd2333 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Thu, 20 Oct 2022 22:00:18 +0200 Subject: [PATCH] Add isort and activate CI fail for black/isort. --- .github/workflows/ci.yml | 5 ++++- requirements.txt | 2 +- setup.cfg | 2 +- tox.ini | 17 +++++++++++++++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df9a70ceb5..0880cbf951 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -190,8 +190,11 @@ jobs: - name: flake8 tox: flake8 # continue_on_error: true + - name: isort + tox: isort_CI + # continue_on_error: true - name: black - tox: black + tox: black_CI # continue_on_error: true - name: Docs tox: docs diff --git a/requirements.txt b/requirements.txt index 8ef5be05c9..fc5cf4fb10 100644 --- a/requirements.txt +++ b/requirements.txt @@ -65,7 +65,7 @@ pep8==1.7.1 pyflakes==2.4.0 pydocstyle==6.1.1 pycodestyle==2.8.0 -pylint==2.14.5 +pylint==2.15.4 pytest==7.1.2 pytest-asyncio==0.18.3 pytest-cov==3.0.0 diff --git a/setup.cfg b/setup.cfg index 9c07b4484e..4dff916ac3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -543,7 +543,7 @@ omit = [isort] py_version=38 profile=black -line_length = 80 +line_length = 79 lines_after_imports = 2 known_local_folder = common diff --git a/tox.ini b/tox.ini index 720373ccff..61bf3bcdbd 100644 --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,13 @@ commands = deps = -r requirements.txt ignore_errors = false commands = - isort examples pymodbus test + isort --recursive examples pymodbus test + +[testenv:isort_CI] +deps = -r requirements.txt +ignore_errors = false +commands = + isort --check --recursive examples pymodbus test [testenv:bandit] deps = -r requirements.txt @@ -44,14 +50,22 @@ commands = [testenv:flake8] deps = -r requirements.txt +ignore_errors = false commands = flake8 doc/ examples/ pymodbus/ test/ [testenv:black] deps = -r requirements.txt +ignore_errors = false commands = black --safe --quiet examples/ pymodbus/ test/ +[testenv:black_CI] +deps = -r requirements.txt +ignore_errors = false +commands = + black --check --safe --quiet examples/ pymodbus/ test/ + [testenv:docs] allowlist_externals = make @@ -68,4 +82,3 @@ commands = ls -la coverage_reports coverage combine coverage_reports coverage report --fail-under=60 --ignore-errors -