From f44432cd27e8762ba78fb87b70984f33b41d6522 Mon Sep 17 00:00:00 2001 From: JSv4 Date: Sun, 16 Jun 2024 21:34:20 -0700 Subject: [PATCH] Still not sure why linter is broken in action... working locally. --- .github/workflows/backend.yml | 2 +- .pre-commit-config.yaml | 42 ++++++++++++++++++++++++++++++++--- requirements/local.txt | 2 +- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 730b3510..b8bf1544 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -56,7 +56,7 @@ jobs: requirements/local.txt - name: Run pre-commit - uses: pre-commit/action@v3.0.0 + uses: pre-commit/action@v3.0.1 # With no caching at all the entire ci process takes 4m 30s to complete! pytest: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e958dfd9..b162a79f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,39 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7939889f0aeef015671f000354a040077f007656514f43eaf6fe61fd221da796 -size 941 +exclude: "/migrations/|frontend/|.idea/|README.md|pytest.xml|pytest-coverage.txt" +default_stages: [commit] + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + + - repo: https://github.com/asottile/pyupgrade + rev: v2.32.1 + hooks: + - id: pyupgrade + args: [--py39-plus] + + - repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + + - repo: https://github.com/PyCQA/isort + rev: 5.12.0 + hooks: + - id: isort + + - repo: https://github.com/PyCQA/flake8 + rev: 4.0.1 + hooks: + - id: flake8 + args: ["--config=setup.cfg"] + additional_dependencies: [flake8-isort] + +# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date +ci: + autoupdate_schedule: weekly + skip: [] + submodules: false diff --git a/requirements/local.txt b/requirements/local.txt index 17e4cb6b..c99927ab 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -34,7 +34,7 @@ coverage==6.5.0 # https://github.com/nedbat/coveragepy black==22.10.0 # https://github.com/psf/black pylint-django==2.5.3 # https://github.com/PyCQA/pylint-django pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery -pre-commit==2.20.0 # https://github.com/pre-commit/pre-commit +pre-commit==3.7.1 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------