From a2829fe9a7d0414e2f94bf2d8b5f5f1caba193fe Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 17 Jan 2021 16:19:16 +0000 Subject: [PATCH 1/5] Add flake8 via pre-commit --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..a4cf61eb --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: + - repo: https://gitlab.com/pycqa/flake8 + rev: "3.8.4" + hooks: + - id: flake8 From 9b0c13c0b14ab44071b714e1abe33f2673c4a30e Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 17 Jan 2021 16:24:20 +0000 Subject: [PATCH 2/5] Run pre-commit via GitHub Actions --- .github/workflows/tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 80ac12af..9773d749 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,3 +27,10 @@ jobs: if: matrix.os == 'Windows' && matrix.python == '2.7' - run: nox -s tests-${{ matrix.python }} + + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: pre-commit/action@v2.0.0 From 3c29581369a16e04ae242b04cc7ef301f8aecb2a Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 17 Jan 2021 16:29:00 +0000 Subject: [PATCH 3/5] Annotate the flake8 pre-commit output --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9773d749..d0c4f2bb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,4 +33,6 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 + - name: Setup flake8 annotations + uses: rbialon/flake8-annotations@v1 - uses: pre-commit/action@v2.0.0 From 726160349eb77c2030d274a3947eb7ee7da72cec Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 17 Jan 2021 16:36:46 +0000 Subject: [PATCH 4/5] Run pre-commit (and hence flake8) against both python versions --- .github/workflows/tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d0c4f2bb..c163006f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,10 +29,16 @@ jobs: - run: nox -s tests-${{ matrix.python }} pre-commit: + name: Pre-Commit Python ${{ matrix.python }} runs-on: ubuntu-latest + strategy: + matrix: + python: ['2.7', '3.7'] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} - name: Setup flake8 annotations uses: rbialon/flake8-annotations@v1 - uses: pre-commit/action@v2.0.0 From 60dc1561b3f6d1e4735c74c1e8cd69339cfc6b62 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Mon, 18 Jan 2021 15:53:51 +0000 Subject: [PATCH 5/5] Just test on one Python version --- .github/workflows/tests.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c163006f..8ef9c0f1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,16 +29,11 @@ jobs: - run: nox -s tests-${{ matrix.python }} pre-commit: - name: Pre-Commit Python ${{ matrix.python }} + name: Pre-Commit runs-on: ubuntu-latest - strategy: - matrix: - python: ['2.7', '3.7'] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - name: Setup flake8 annotations uses: rbialon/flake8-annotations@v1 - uses: pre-commit/action@v2.0.0