From 78c36997b15225558899f7612410c64a2e258545 Mon Sep 17 00:00:00 2001 From: Mirko Galimberti Date: Tue, 14 Apr 2020 18:10:55 +0200 Subject: [PATCH] Add flake8 --- .github/workflows/kivy_ios.yml | 16 ++++++++++++++++ tox.ini | 24 ++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 tox.ini diff --git a/.github/workflows/kivy_ios.yml b/.github/workflows/kivy_ios.yml index b1deb1b..e879721 100644 --- a/.github/workflows/kivy_ios.yml +++ b/.github/workflows/kivy_ios.yml @@ -3,6 +3,22 @@ name: kivy-ios on: [push, pull_request] jobs: + flake8: + name: Flake8 tests + runs-on: macos-latest + steps: + - name: Checkout kivy-ios + uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v1.1.0 + with: + python-version: 3.7 + - name: Run flake8 + run: | + python -m pip install --upgrade pip + pip install tox>=2.0 + tox -e pep8 + build_updated_recipes: runs-on: macos-latest steps: diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..791ddcb --- /dev/null +++ b/tox.ini @@ -0,0 +1,24 @@ +[tox] +skipsdist = True +envlist = pep8 +basepython = python3 + +[testenv] +deps = -r{toxinidir}/requirements.txt +setenv = + PYTHONPATH={toxinidir} + +[testenv:pep8] +deps = flake8 +commands = flake8 recipes/ tools/ tests/ .ci/ toolchain.py + +[flake8] +ignore = + E123, # Closing bracket does not match indentation of opening bracket's line + E124, # Closing bracket does not match visual indentation + E126, # Continuation line over-indented for hanging indent + E226, # Missing whitespace around arithmetic operator + E402, # Module level import not at top of file + E501, # Line too long (82 > 79 characters) + W503, # Line break occurred before a binary operator + W504 # Line break occurred after a binary operator