From aadc9c8de1eebb83c5d6d3fe06d46847090ec1dd Mon Sep 17 00:00:00 2001 From: Alan Barzilay Date: Fri, 3 Sep 2021 20:49:55 -0300 Subject: [PATCH] Add flake8 github action with review dog Review dog is an incredible project that makes linting and formatting review a breeze by commenting inline what is wrong in a pull request. This makes the review process easier for the maintainer and also provides a clearer feedback to the contributor --- .github/workflows/flake8.yml | 20 ++++++++++++++++++++ tox.ini | 9 +-------- 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/flake8.yml diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml new file mode 100644 index 0000000..819104d --- /dev/null +++ b/.github/workflows/flake8.yml @@ -0,0 +1,20 @@ +name: flake8 + +on: pull_request + +jobs: + flake8-lint: + runs-on: ubuntu-latest + name: Lint + steps: + - name: Check out source repository + uses: actions/checkout@v2 + - name: Set up Python environment + uses: actions/setup-python@v2 + with: + python-version: "3.9" + - name: flake8 Lint + uses: reviewdog/action-flake8@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-pr-review diff --git a/tox.ini b/tox.ini index 253097e..6d7a99a 100644 --- a/tox.ini +++ b/tox.ini @@ -6,11 +6,4 @@ setenv = PYTHONPATH = {toxinidir}:{toxinidir}/pipreqs commands = python setup.py test deps = - -r{toxinidir}/requirements.txt - -[testenv:flake8] -basepython = python3.9 -commands = flake8 pipreqs -deps = - -r{toxinidir}/requirements.txt - flake8 + -r{toxinidir}/requirements.txt \ No newline at end of file