add: import code
портирован и слегка подправлен код из старого репозитория https://di9.ru/git/Voomra/Conventional-Commits
This commit is contained in:
34
README.MD
Normal file
34
README.MD
Normal file
@@ -0,0 +1,34 @@
|
||||
# Commit-lint plugin for Gradle
|
||||
|
||||
Плагин Gradle для проверки описаний коммитов на соответствие [соглашению о коммитах](https://di9.ru/git/Conventional-Commits/specification/src/branch/master/CONVENTIONAL_COMMITS.MD).
|
||||
|
||||
## Использование
|
||||
|
||||
Добавить git hook `commit-msg`:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env sh
|
||||
./gradlew --console=plain -q commitlint -PgitCommitMessageFile="$1"
|
||||
```
|
||||
|
||||
| Параметр | Описание | По-умолчанию |
|
||||
|:-------------------------|:--------------------------------|-----------------------|
|
||||
| `-PgitCommitMessageFile` | Путь до файла сообщения коммита | `.git/COMMIT_EDITMSG` |
|
||||
|
||||
### Настройка
|
||||
|
||||
```groovy
|
||||
commitlint {
|
||||
types = ["build", "docs", "add", "tweak", "fix", "remove", "revert", "perf", "refac", "style", "test"]
|
||||
contexts = ["git", "ide"]
|
||||
excludes = ["^wip\$"]
|
||||
maxLengthLine = 72
|
||||
}
|
||||
```
|
||||
|
||||
| Настройка | Описание | По-умолчанию |
|
||||
|:----------------|:------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `types` | Перечисление допустимых типов коммитов | _весь перечень типов из [документа соглашения](https://di9.ru/git/Conventional-Commits/specification/src/branch/master/CONVENTIONAL_COMMITS.MD)_ |
|
||||
| `contexts` | Перечисление допустимых контекстов | _весь перечень контекстов из [документа соглашения](https://di9.ru/git/Conventional-Commits/specification/src/branch/master/CONVENTIONAL_COMMITS.MD)_ |
|
||||
| `excludes` | Перечисление шаблонов для исключений | `^wip$` |
|
||||
| `maxLengthLine` | Максимальная длинна первой строки коммита | 72 |
|
||||
Reference in New Issue
Block a user