From c8ca8e9ce34c21b26caa7f16e1f0a5c08766c920 Mon Sep 17 00:00:00 2001 From: dom-inic Date: Tue, 14 May 2024 21:58:05 +0300 Subject: [PATCH] pre-commit config --- .pre-commit-config.yaml | 49 +++++++++++++++++++++++++++++++++++++ requirements/base.txt | 14 +++++++++++ requirements/local.txt | 5 ++++ requirements/production.txt | 8 ++++++ 4 files changed, 76 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 requirements/base.txt create mode 100644 requirements/local.txt create mode 100644 requirements/production.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..dc2ccda --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,49 @@ +exclude: '^docs/|/migrations/|devcontainer.json' +default_stages: [commit] + +default_language_version: + python: python3.9.6 + +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-json + - id: check-toml + - id: check-xml + - id: check-yaml + - id: debug-statements + - id: check-builtin-literals + - id: check-case-conflict + - id: check-docstring-first + - id: detect-private-key + + - repo: https://github.com/adamchainz/django-upgrade + rev: '1.16.0' + hooks: + - id: django-upgrade + args: ['--target-version', '4.0'] + + # Run the Ruff linter. + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.3.5 + hooks: + # Linter + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + # Formatter + - id: ruff-format + + - repo: https://github.com/Riverside-Healthcare/djLint + rev: v1.34.1 + hooks: + - id: djlint-reformat-django + - id: djlint-django + +# 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/base.txt b/requirements/base.txt new file mode 100644 index 0000000..5f3c7bc --- /dev/null +++ b/requirements/base.txt @@ -0,0 +1,14 @@ +braintree==4.21.0 +celery==5.3.1 +Django==4.1.7 +django-filter==22.1 +django-localflavor==4.0 +django-parler==2.3 +django-rosetta==0.9.9 +djangorestframework==3.14.0 +humanize==4.7.0 +Pillow==9.4.0 +psycopg2-binary==2.9.9 +python-dotenv==1.0.0 +redis==5.0.0 +requests==2.31.0 diff --git a/requirements/local.txt b/requirements/local.txt new file mode 100644 index 0000000..77ed800 --- /dev/null +++ b/requirements/local.txt @@ -0,0 +1,5 @@ +-r base.txt + +amqp==5.1.19 +flower==2.0.0 +weasyprint==59.0 diff --git a/requirements/production.txt b/requirements/production.txt new file mode 100644 index 0000000..565997d --- /dev/null +++ b/requirements/production.txt @@ -0,0 +1,8 @@ +-r base.txt + +boto3==1.29.7 +botocore==1.32.7 +django-storages==1.14.2 +gunicorn==21.2.0 +s3transfer==0.8.0 +whitenoise==6.6.0