فحص قبل الالتزام بـ pre-commit
pre-commit Hooks
فحوص تلقائية قبل كل التزام: التنسيق، والملفات الكبيرة، والمفاتيح الخاصة.
الخطوات
ثبّت الأداة: pip install pre-commit.
أنشئ .pre-commit-config.yaml.
فعّلها: pre-commit install.
شغّلها على كل الملفات: pre-commit run --all-files.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace