Some checks failed
CI/CD Pipeline / Run Tests (push) Failing after 45s
CI/CD Pipeline / Code Quality Checks (push) Failing after 48s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped
94 lines
2.6 KiB
YAML
94 lines
2.6 KiB
YAML
default_install_hook_types: [pre-commit, pre-push]
|
|
default_stages: [pre-commit]
|
|
minimum_pre_commit_version: "3.6.0"
|
|
|
|
repos:
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.1.14
|
|
hooks:
|
|
- id: ruff
|
|
name: ruff lint
|
|
files: ^(src|tests|scripts)/.*\.py$
|
|
args: [--fix, --exit-non-zero-on-fix]
|
|
exclude: |
|
|
(?x)^(
|
|
src/.*/migrations/.*|
|
|
.*/__pycache__/.*
|
|
)$
|
|
|
|
- id: ruff-format
|
|
name: ruff format
|
|
files: ^(src|tests|scripts)/.*\.py$
|
|
args: []
|
|
exclude: |
|
|
(?x)^(
|
|
src/.*/migrations/.*|
|
|
.*/__pycache__/.*
|
|
)$
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.5.0
|
|
hooks:
|
|
- id: trailing-whitespace
|
|
name: check trailing whitespace
|
|
|
|
- id: end-of-file-fixer
|
|
name: fix end of file
|
|
|
|
- id: check-yaml
|
|
name: check yaml syntax
|
|
files: ^(\.gitea/workflows/.*\.ya?ml|docker-compose.*\.ya?ml|.*\.ya?ml)$
|
|
|
|
- id: check-added-large-files
|
|
name: check large files
|
|
args: ["--maxkb=500"]
|
|
|
|
- id: check-merge-conflict
|
|
- id: detect-private-key
|
|
|
|
- repo: https://github.com/hadolint/hadolint
|
|
rev: v2.12.0
|
|
hooks:
|
|
- id: hadolint-docker
|
|
name: hadolint dockerfiles
|
|
files: ^docker/.*Dockerfile.*$
|
|
|
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
|
rev: v0.11.0.1
|
|
hooks:
|
|
- id: shellcheck
|
|
files: ^(scripts|docker/scripts)/.*\.sh$
|
|
|
|
- repo: local
|
|
hooks:
|
|
- id: django-check-migrations
|
|
name: django check migrations
|
|
entry: ./scripts/check-migrations.sh
|
|
language: script
|
|
files: ^src/.*\.py$
|
|
pass_filenames: false
|
|
exclude: |
|
|
(?x)^(
|
|
src/.*/migrations/.*|
|
|
src/.*/__pycache__/.*
|
|
)$
|
|
- id: docker-compose-dev-config
|
|
name: docker compose dev config check
|
|
entry: docker compose -f docker-compose.dev.yml config -q
|
|
language: system
|
|
pass_filenames: false
|
|
files: ^(docker-compose\.dev\.yml|docker/Dockerfile|docker/scripts/.*\.sh)$
|
|
- id: docker-compose-prod-config
|
|
name: docker compose prod config check
|
|
entry: docker compose -f docker-compose.prod.yml --env-file .env.prod config -q
|
|
language: system
|
|
pass_filenames: false
|
|
files: ^(docker-compose\.prod\.yml|docker/Dockerfile|docker/scripts/.*\.sh|\.env\.prod)$
|
|
- id: pytest
|
|
name: pytest suite
|
|
entry: ./scripts/run-tests.sh
|
|
language: script
|
|
pass_filenames: false
|
|
stages: [pre-push]
|
|
always_run: true
|