From: Ɓukasz Langa Date: Fri, 16 Mar 2018 07:42:15 +0000 (-0700) Subject: Add flake8 to CI, too X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/0de0851a47cc36173028b52743caff0af0344278?ds=inline;hp=1ec7544ab74caa080d6597c13bcc5927b75aca41 Add flake8 to CI, too --- diff --git a/.flake8 b/.flake8 index cf36923..71d8a46 100644 --- a/.flake8 +++ b/.flake8 @@ -4,5 +4,5 @@ [flake8] ignore = E266, E501 max-line-length = 80 -max-complexity = 12 +max-complexity = 15 select = B,C,E,F,W,T4,B9 diff --git a/.travis.yml b/.travis.yml index 804b39d..8e88019 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,12 @@ sudo: false language: python cache: pip before_script: -- pip install mypy +- pip install flake8 flake8-bugbear mypy - pip install -e . script: - python setup.py test - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then mypy black.py tests/test_black.py; fi +- if [[ $TRAVIS_PYTHON_VERSION == '3.6-dev' ]]; then flake8 black.py tests/test_black.py; fi notifications: on_success: change on_failure: always diff --git a/black.py b/black.py index 6b347ba..48ba0a2 100644 --- a/black.py +++ b/black.py @@ -807,7 +807,7 @@ BRACKETS = OPENING_BRACKETS | CLOSING_BRACKETS ALWAYS_NO_SPACE = CLOSING_BRACKETS | {token.COMMA, token.COLON, STANDALONE_COMMENT} -def whitespace(leaf: Leaf) -> str: +def whitespace(leaf: Leaf) -> str: # noqa C901 """Return whitespace prefix if needed for the given `leaf`.""" NO = '' SPACE = ' '