name: flake8 lint

on: [push, pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python_version:
          - '3.7'
    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python_version }}
    - run: pip install flake8
    - run: |
        # stop the build if there are Python syntax errors or undefined names
        flake8 . --count --show-source --statistics
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
        flake8 . --count --exit-zero --statistics
