chore(deps): update pre-commit config and apply bulk formatting

- build(pre-commit): upgrade hooks (django-upgrade 1.29.1, uv 0.9.7, ruff 0.14.3, bandit 1.8.6)
- build(pre-commit): add uv-lock hook, tombi TOML formatter, prettier-plugin-packagejson
- build(pre-commit): disable Django check hooks (commented out)
- build(pre-commit): switch npx → bunx for prettier execution
- build(node): add bun.lock, update prettier config with schema + packagejson plugin
- style: apply ruff format to all Python files (comments, spacing, imports)
- style: apply prettier format to all JS/CSS files (comment styles, spacing)
- style: apply tombi format to pyproject.toml (reordered sections, consistent formatting)
- chore: remove emoji from bash script comments for consistency

BREAKING CHANGE: Django check and migration check hooks disabled in pre-commit config
This commit is contained in:
2025-11-05 14:34:08 +01:00
parent b1b5207888
commit c106792e78
35 changed files with 615 additions and 328 deletions

View File

@@ -13,21 +13,25 @@ default_language_version:
repos:
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.25.0
rev: 1.29.1
hooks:
- id: django-upgrade
# uv hooks for dependency management
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.7.12
rev: 0.9.7
hooks:
# Update the uv lockfile
- id: uv-lock
# Update the requirements.txt
- id: uv-export
# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
# - id: check-json
@@ -50,12 +54,12 @@ repos:
- prettier
- prettier-plugin-jinja-template
types_or: [html, jinja]
entry: npx prettier --plugin=prettier-plugin-jinja-template --parser=jinja-template --write
entry: bunx prettier --plugin=prettier-plugin-jinja-template --parser=jinja-template --write
- id: prettier-all
name: Prettier All
language: node
types_or: [javascript, jsx, ts, tsx, css, scss, json, yaml, markdown]
entry: npx prettier --write
entry: bunx prettier --write
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.18.1
@@ -65,40 +69,49 @@ repos:
# Ruff for linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.13
rev: v0.14.3
hooks:
- id: ruff
# Run the linter.
- id: ruff-check
args: [--fix]
# Run the formatter.
- 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]
# # 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]
# - 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
rev: 1.8.6
hooks:
- id: bandit
args: [-c, pyproject.toml, -r, dashboard_project]
# additional_dependencies: ["bandit[toml]"]
# TOML formatting and linting
- repo: https://github.com/tombi-toml/tombi-pre-commit
rev: v0.6.40
hooks:
- id: tombi-format
- id: tombi-lint
# # Type checking
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.15.0