aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2022-05-28 20:35:19 -0700
committerGravatar MarkKoz <[email protected]>2022-05-28 20:35:19 -0700
commit8981640d0b9c39c1329d955670e5c13a4ce92d75 (patch)
tree3bf552483ceca60219d157ed5bccd68a8107c648 /.github
parentReplace ASCII diagram with mermaid sequence diagram (diff)
Deps: specify flake8 deps via pre-commit
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/lint.yaml44
1 files changed, 7 insertions, 37 deletions
diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml
index 8f530ab..abd7952 100644
--- a/.github/workflows/lint.yaml
+++ b/.github/workflows/lint.yaml
@@ -6,21 +6,10 @@ jobs:
name: Lint
runs-on: ubuntu-latest
env:
- PIP_DISABLE_PIP_VERSION_CHECK: 1
- PIP_NO_CACHE_DIR: false
- PIP_USER: 1 # Make dependencies install into PYTHONUSERBASE.
-
- PIPENV_DONT_USE_PYENV: 1
- PIPENV_HIDE_EMOJIS: 1
- PIPENV_NOSPIN: 1
-
- PYTHONUSERBASE: ${{ github.workspace }}/.cache/py-user-base
PRE_COMMIT_HOME: ${{ github.workspace }}/.cache/pre-commit-cache
+ PIP_DISABLE_PIP_VERSION_CHECK: 1
steps:
- - name: Add custom PYTHONUSERBASE to PATH
- run: echo '${{ env.PYTHONUSERBASE }}/bin/' >> $GITHUB_PATH
-
- name: Checkout code
uses: actions/checkout@v2
@@ -30,21 +19,8 @@ jobs:
with:
python-version: "3.10"
- - name: Python dependency cache
- uses: actions/cache@v2
- id: python_cache
- with:
- path: ${{ env.PYTHONUSERBASE }}
- key: "python-0-${{ runner.os }}-${{ env.PYTHONUSERBASE }}-\
- ${{ steps.python.outputs.python-version }}-\
- ${{ hashFiles('./Pipfile', './Pipfile.lock') }}"
-
- # Install dependencies if there was a cache miss.
- - name: Install Python dependencies
- if: steps.python_cache.outputs.cache-hit != 'true'
- run: >-
- pip install pipenv==2021.11.23
- && pipenv install --deploy --system --dev
+ - name: Install pre-commit
+ run: pip install pre-commit~=2.9.3
- name: Pre-commit environment cache
uses: actions/cache@v2
@@ -54,20 +30,14 @@ jobs:
${{ steps.python.outputs.python-version }}-\
${{ hashFiles('./.pre-commit-config.yaml') }}"
- # pre-commit's venv doesn't work with user installs.
- # Skip the flake8 hook because the following step will run it.
+ # Skip the flake8 hook because the following command will run it.
- name: Run pre-commit hooks
id: run-pre-commit-hooks
- run: PIP_USER=0 SKIP=flake8 pre-commit run --all-files
+ run: |
+ SKIP=flake8 pre-commit run --all-files
+ pre-commit run --all-files --hook-stage manual flake8-annotate
# Show the log to debug failures.
- name: Show pre-commit log
if: always() && steps.run-pre-commit-hooks.outcome == 'failure'
run: cat "${PRE_COMMIT_HOME}/pre-commit.log"
-
- # Output linting errors in the format GitHub Actions recognises for
- # annotations.
- - name: Run flake8
- run: >-
- flake8 --format "::error
- file=%(path)s,line=%(row)d,col=%(col)d::[flake8] %(code)s: %(text)s"