From 174c3e1e6a8ad6d03fc5f57001f9527cc912c30c Mon Sep 17 00:00:00 2001 From: Alec Li Date: Sat, 23 Dec 2023 13:51:51 -0800 Subject: [PATCH] Move pylint to use docker, modify pre-commit ci --- .github/workflows/pre-commit.yml | 8 +++++++- .pre-commit-config.yaml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 832b7faf..0cd72587 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -19,6 +19,12 @@ jobs: - name: Parse Python version from runtime.txt run: | sed 's/[^0-9.]//g' runtime.txt | head > .python-version + - name: Set up Pylint pre-commit + run: | + # remove all instances of docker compose exec; github CI doesn't use docker + sed -E 's/docker compose exec -T \w+\s*//g' .pre-commit-config.yaml > .pre-commit-config-ci.yaml + mv .pre-commit-config-ci.yaml .pre-commit-config.yaml + touch .env # ensure .env file exists - name: Set up Python uses: actions/setup-python@v4 - name: Install Poetry @@ -29,7 +35,7 @@ jobs: installer-parallel: true - name: Install dependencies with Poetry run: | - poetry install --no-root --with=dev --no-interaction --no-ansi + poetry install --no-root --with=prod --no-interaction --no-ansi # add virtual environment to path for future steps echo $(poetry env info --path)/bin >> $GITHUB_PATH - name: Install npm dependencies diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2df1d956..87ac4553 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: hooks: - id: pylint name: pylint - entry: pylint + entry: docker compose exec -T django pylint language: system types: [python] args: [