用户工具

站点工具


django:pre-commit

这是本文档旧的修订版!


pre-commit

install

Bash
  1. uv add pre-commit
Bash
  1. uv run pre-commit install

conf

yaml
  1. # See https://pre-commit.com for more information
  2. # See https://pre-commit.com/hooks.html for more hooks
  3. repos:
  4. - repo: https://github.com/pre-commit/pre-commit-hooks
  5. rev: v3.2.0
  6. hooks:
  7. - id: trailing-whitespace
  8. - id: end-of-file-fixer
  9. - id: check-yaml
  10. - id: check-added-large-files
  11. - repo: https://github.com/astral-sh/ruff-pre-commit
  12. # Ruff version.
  13. rev: v0.12.9
  14. hooks:
  15. # Run the linter.
  16. - id: ruff-check
  17. args: [ --fix ]
  18. # Run the formatter.
  19. - id: ruff-format
/storage/data/attic/django/pre-commit.1755701277.txt.gz · 最后更改: bestony

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki