From 72e7c600f345f96923e64cc4ef47bc6d91b8c9fb Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Tue, 19 May 2020 19:24:22 +0300 Subject: [PATCH 1/2] Add a 'tox -e flake8' --- setup.cfg | 17 +++++++++++++++++ tox.ini | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/setup.cfg b/setup.cfg index 562ebf2d..5775e97f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,3 +13,20 @@ python = python [bdist_wheel] universal = 0 + +[flake8] +builtins = _ +max-line-length = 80 +extend-ignore = +# https://pep8.readthedocs.org/en/latest/intro.html#error-codes +# these are ignored by default: +# E121: continuation line under-indented for hanging indent +# E123: closing bracket does not match indentation of opening bracket’s line +# E126: continuation line over-indented for hanging indent +# E133: closing bracket does not match visual indentation +# E226: missing whitespace around arithmetic operator +# E241: multiple spaces after ‘,’ +# E242: tab after ‘,’ +# E704: multiple statements on one line (def) +# W503: line break before binary operator +# W504: line break after binary operator diff --git a/tox.ini b/tox.ini index f3d9846c..3e8d622d 100644 --- a/tox.ini +++ b/tox.ini @@ -31,3 +31,8 @@ deps = pyxdg dnspython {[base]deps} + +[testenv:flake8] +deps = flake8 +skip_install = true +commands = flake8 setup.py linkcheck {posargs} From 7a43abe6d6b17b69e20540b4d01289590c1dcec4 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Tue, 19 May 2020 19:26:33 +0300 Subject: [PATCH 2/2] Add a flake8 job to the Travis matrix https://docs.travis-ci.com/user/build-matrix/#rows-that-are-allowed-to-fail suggests that this might not work. --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 075beddb..5784a31b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,13 @@ jobs: include: - python: "3.5" env: TOXENV=oldbs4 + - name: flake8 + env: TOXENV=flake8 + before_script: + after_success: + allow_failures: + - name: flake8 + env: TOXENV=flake8 # command to install dependencies addons: apt: