cookiecutter-django/.pre-commit-config.yaml

45 lines
1.1 KiB
YAML
Raw Normal View History

exclude: "{{cookiecutter.project_slug}}|.github/contributors.json|CHANGELOG.md|CONTRIBUTORS.md"
2024-10-06 05:40:22 +03:00
default_stages: [pre-commit]
minimum_pre_commit_version: "3.2.0"
default_language_version:
2025-09-22 13:03:50 +03:00
python: python3.13
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.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: detect-private-key
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
args: ["--tab-width", "2"]
Move template linting and formatting to ruff (#5613) * Move template linting and formatting to ruff The generated project already uses that, let's be consistent and use it everywhere * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove comments as they're wrongly placed * Tweak multi-line comment * Remove a couple of commented out Ruff rules * Fix extend-exclude in Ruff config * Adjust Ruff line length * Run Ruff pre-commit hook * Run Ruff with --unsafe-fixes * Run Ruff with --add-noqa * Run Ruff formatter * Drop Python 2 in pre/post generation hooks * Restore print statements in pre/post-generation hooks * Restore print statements in scripts * Indent toml with 2 spaces * Exclude docs and revert most changes from Ruff * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix Ruff issue * Disable PLR0133 in pre/post commit hooks We seem to compare 2 constants but seem strings are in fact interpolated in Jinja. https://docs.astral.sh/ruff/rules/comparison-of-constant/ * Migrate post-generation hook to pathlib * Migrate post-generation hook to pathlib * Fix typo in folder name * Migrate test generation to pathlib * Fix typo in folder name * Format comment better * Update pyproject.toml * Disable TRY003 * Update Ruff version pre-commit config * Apply suggestions from code review * Remove env from tox envlist * Align ruff in pre-commit config * Update .pre-commit-config.yaml * Bump Ruff version * Bump ruff pre-commit version * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove isort tests as it's no longer used --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-08-29 11:12:25 +03:00
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.11
hooks:
Move template linting and formatting to ruff (#5613) * Move template linting and formatting to ruff The generated project already uses that, let's be consistent and use it everywhere * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove comments as they're wrongly placed * Tweak multi-line comment * Remove a couple of commented out Ruff rules * Fix extend-exclude in Ruff config * Adjust Ruff line length * Run Ruff pre-commit hook * Run Ruff with --unsafe-fixes * Run Ruff with --add-noqa * Run Ruff formatter * Drop Python 2 in pre/post generation hooks * Restore print statements in pre/post-generation hooks * Restore print statements in scripts * Indent toml with 2 spaces * Exclude docs and revert most changes from Ruff * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix Ruff issue * Disable PLR0133 in pre/post commit hooks We seem to compare 2 constants but seem strings are in fact interpolated in Jinja. https://docs.astral.sh/ruff/rules/comparison-of-constant/ * Migrate post-generation hook to pathlib * Migrate post-generation hook to pathlib * Fix typo in folder name * Migrate test generation to pathlib * Fix typo in folder name * Format comment better * Update pyproject.toml * Disable TRY003 * Update Ruff version pre-commit config * Apply suggestions from code review * Remove env from tox envlist * Align ruff in pre-commit config * Update .pre-commit-config.yaml * Bump Ruff version * Bump ruff pre-commit version * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove isort tests as it's no longer used --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-08-29 11:12:25 +03:00
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.11.1"
hooks:
- id: pyproject-fmt
ci:
autoupdate_schedule: weekly
skip: []
submodules: false