From d8bcb80f765052a072a76a22cb6f885158922984 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 18 May 2022 07:55:40 +0800 Subject: improve compatibility of flake8 with black --- .flake8 | 5 ++++- .github/workflows/pythonpackage.yml | 5 +++++ requirements-dev.txt | 6 +----- test-requirements.txt | 2 ++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.flake8 b/.flake8 index c55fe35d..47d40978 100644 --- a/.flake8 +++ b/.flake8 @@ -25,7 +25,6 @@ ignore = E265,E266,E731,E704, A, D, RST, RST3 -max-line-length = 120 exclude = .tox,.venv,build,dist,doc,git/ext/,test @@ -33,3 +32,7 @@ rst-roles = # for flake8-RST-docstrings attr,class,func,meth,mod,obj,ref,term,var # used by sphinx min-python-version = 3.7.0 + +# for `black` compatibility +max-line-length = 88 +extend-ignore = E203 diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 881f2ec5..1a10a4b2 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -44,6 +44,11 @@ jobs: # and cause subsequent tests to fail cat test/fixtures/.gitconfig >> ~/.gitconfig + - name: Lint with black + run: | + set -x + black --check . + - name: Lint with flake8 run: | set -x diff --git a/requirements-dev.txt b/requirements-dev.txt index f3aad629..bacde349 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,12 +4,8 @@ # libraries for additional local testing/linting - to be added to test-requirements.txt when all pass flake8-type-checking;python_version>="3.8" # checks for TYPE_CHECKING only imports -# flake8-annotations # checks for presence of type annotations -# flake8-rst-docstrings # checks docstrings are valid RST -# flake8-builtins # warns about shadowing builtin names -# flake8-pytest-style +black -# pytest-flake8 pytest-icdiff # pytest-profiling diff --git a/test-requirements.txt b/test-requirements.txt index 53d8e606..d0b8f500 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,8 @@ ddt>=1.1.1, !=1.4.3 mypy +black + flake8 flake8-bugbear flake8-comprehensions -- cgit v1.2.1