Files
livegraphs-django/.pre-commit-config.yaml
Kaj Kowalski 1ed0f5708d
Some checks failed
Bandit / bandit (push) Has been cancelled
Codacy Security Scan / Codacy Security Scan (push) Has been cancelled
Enhances the ship with security and automation!
Adds Dependabot for automatic dependency updates to keep the vessel sea-worthy and updates pre-commit hooks.

Integrates Bandit and Codacy for automated security scans, ensuring a well-defended treasure hold.

Updates devcontainer settings for smoother sailing in the development environment.

Now use foreman for development, to be able to run all processes in development.

Let's keep this ship safe and sound, savvy?
2025-05-19 00:32:52 +02:00

117 lines
2.9 KiB
YAML

# default_install_hook_types:
# - pre-commit
# - post-checkout
# - post-merge
# - post-rewrite
# ci:
# skip: [django-check, django-check-migrations]
default_language_version:
node: 22.15.1
python: python3.13
repos:
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.25.0
hooks:
- id: django-upgrade
# uv hooks for dependency management
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.7.5
hooks:
- id: uv-export
# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
# - id: check-json
- id: check-toml
- id: check-added-large-files
args: [--maxkb=1000]
- id: detect-private-key
- id: check-merge-conflict
- id: check-case-conflict
- id: debug-statements
- id: mixed-line-ending
args: [--fix=lf]
# - repo: https://github.com/psf/black
# rev: 22.10.0
# hooks:
# - id: black
# # HTML/Django template linting
# - repo: https://github.com/rtts/djhtml
# rev: 3.0.7
# hooks:
# - id: djhtml
# entry: djhtml --tabwidth 4
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
additional_dependencies:
- prettier@3.5.3
- prettier-plugin-jinja-template@2.1.0
types_or: [javascript, jsx, ts, tsx, css, scss, html, json, yaml, markdown]
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.18.1
hooks:
- id: markdownlint-cli2
args: [--fix]
# Ruff for linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.10
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
# Django-specific hooks
- repo: local
hooks:
- id: django-check
name: Django Check
entry: uv run python dashboard_project/manage.py check
language: python
pass_filenames: false
types: [python]
always_run: true
additional_dependencies: [uv]
- id: django-check-migrations
name: Django Check Migrations
entry: uv run python dashboard_project/manage.py makemigrations --check --dry-run
language: python
pass_filenames: false
types: [python]
additional_dependencies: [uv]
# Security checks
- repo: https://github.com/pycqa/bandit
rev: 1.8.3
hooks:
- id: bandit
args: [-c, pyproject.toml, -r, dashboard_project]
# additional_dependencies: ["bandit[toml]"]
# # Type checking
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.15.0
# hooks:
# - id: mypy
# additional_dependencies:
# - django-stubs>=5.0.2
# - types-python-dateutil
# - types-requests
# - types-PyYAML