From: Thanh Ha Date: Tue, 28 Jan 2020 15:58:50 +0000 (-0500) Subject: Add GitLint which replaces GitCommitBear X-Git-Tag: v0.31.0~4^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F78%2F62978%2F1;p=releng%2Flftools.git 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 --- 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