From 88b9cd7389b78bb041e63cde5d5de129dc9500ef Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Tue, 28 Jan 2020 10:58:50 -0500 Subject: [PATCH] Add GitLint which replaces GitCommitBear This replaces GitCommitBear with GitLint which does similar linting for git commit messages but using pre-commit hooks. Signed-off-by: Thanh Ha Change-Id: I3480ad81702fa6b5015523a7274e219ba2f240d0 --- .coafile | 8 -------- .pre-commit-config.yaml | 5 +++++ tox.ini | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.coafile b/.coafile index 9412814c..5b4657be 100644 --- a/.coafile +++ b/.coafile @@ -7,14 +7,6 @@ ignore = .tox/**, .pytest_cache/**, node_modules/** -[all.Git] -bears = GitCommitBear -ignore_length_regex = Signed-off-by, - Also-by, - Co-authored-by, - http://, - https:// - [all.Documentation] bears = WriteGoodLintBear files = docs/**/*.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ce053483..43bd6f95 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,3 +4,8 @@ repos: rev: v1.3.0 hooks: - id: trailing-whitespace + + - repo: https://github.com/jorisroovers/gitlint + rev: v0.12.0 + hooks: + - id: gitlint diff --git a/tox.ini b/tox.ini index d86a5ca8..87b25baf 100644 --- a/tox.ini +++ b/tox.ini @@ -60,8 +60,8 @@ commands = basepython = python3 deps = pre-commit commands = - pre-commit install pre-commit run --all-files + pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG [testenv:reno] basepython = python3 -- 2.16.6