The Coala linter for GitCommit Hooks requires the Python NLTK
library which in the past couple of days started depending on
numpy. Let's switch to pre-commit so that we don't have to pull
in numpy.
Change-Id: Ic13381bccaf6e113f9e617b8ed840624b769e47b
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
**/target/**,
**/thrift/**,
-[all.GitCommit]
-bears = GitCommitBear
-ignore_length_regex = Signed-off-by,
- Also-by,
- Co-authored-by,
- http://,
- https://
-
[all.reStructuredText]
bears = RSTcheckBear
files = **.rst
ignore = .**
enabled = False
-
-[all.Spacing]
-bears = SpaceConsistencyBear
-files = **/*.java
-use_spaces = True
-allow_trailing_whitespace = False
-enforce_newline_at_EOF = True
-default_actions = SpaceConsistencyBear: ApplyPatchAction
--- /dev/null
+---
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v1.3.0
+ hooks:
+ - id: trailing-whitespace
+
+ - repo: https://github.com/jorisroovers/gitlint
+ rev: v0.11.0
+ hooks:
+ - id: gitlint
+
[tox]
minversion = 1.6.0
-envlist = coala,docs
+envlist = coala,docs,pre-commit
skipsdist = true
[testenv:coala]
pygments~=2.3.1
requests~=2.21.0
commands =
- python3 -m nltk.downloader punkt maxent_treebank_pos_tagger averaged_perceptron_tagger
coala --non-interactive
[testenv:docs]
deps = -rdocs/requirements.txt
commands =
sphinx-build -W -n -b html -d {envtmpdir}/doctrees ./docs/ {envtmpdir}/html
+
+[testenv:pre-commit]
+deps = pre-commit
+commands =
+ pre-commit install --hook-type commit-msg
+ pre-commit run --all-files