Files
service-configs/README.md
2024-02-01 12:02:01 +03:00

29 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## Настройка проверки коммитов
В данном репозитории включена проверка коммитов на наличие ссылки на Jira тикет. Все коммиты, которые не имеют референса, типа "[MEC-123] Some commit text", будут откланены гит репозиторием. Для автоматизации подстановки Jira ID в комментарий комита, нужно использовать преднастроенный pre-commit
https://confluence.ncloudtech.ru/pages/viewpage.action?pageId=201708163
### Настройка pre-commit на локальной машине
Для автоматизации используется фреймворк pre-commit: https://pre-commit.com/
Дополнительная информация доступна здесь: https://confluence.ncloudtech.ru/pages/viewpage.action?pageId=201701553
```bash
#!/bin/sh
# Install pre-commit framework
pip install pre-commit
pre-commit --version
# Configure local GIT to store hooks templates in separate folder in user space
# This is necessary, as GIT Sub-modules will not get pre-configured hooks from pre-commit framework
# Please reference to article for more info: https://confluence.ncloudtech.ru/pages/viewpage.action?pageId=201701553
git config --global init.templateDir ~/.git-template
pre-commit init-templatedir ~/.git-template
# Install pre-commit packages (Need to do on each new git repository):
pre-commit install
pre-commit install --hook-type prepare-commit-msg
```