Use pre-commit instead of Coala 04/15604/2
authorThanh Ha <zxiiro@gmail.com>
Sat, 11 May 2019 01:24:47 +0000 (21:24 -0400)
committerThanh Ha <zxiiro@gmail.com>
Sat, 11 May 2019 01:53:10 +0000 (21:53 -0400)
Considering that all we're using Coala for is for the GitCommitBear
let's drop Coala in favor of pre-commit as it's faster and more
convenient.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I852ced87ea859a4424e41d461e9adce01732b8ba

.coafile [deleted file]
.pre-commit-config.yaml [new file with mode: 0644]
tox.ini

diff --git a/.coafile b/.coafile
deleted file mode 100644 (file)
index de44e1f..0000000
--- a/.coafile
+++ /dev/null
@@ -1,16 +0,0 @@
-[all]
-ignore = .tox/**,
-    .git/**,
-    .gitignore,
-    .gitmodules,
-    .gitreview
-
-[all.Git]
-bears = GitCommitBear
-files = NONE
-ignore_length_regex = Signed-off-by,
-    Also-by,
-    Co-authored-by,
-    http://,
-    https://
-
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644 (file)
index 0000000..c1879a6
--- /dev/null
@@ -0,0 +1,11 @@
+---
+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
diff --git a/tox.ini b/tox.ini
index df46764..b1f51c5 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,19 +1,10 @@
 [tox]
 minversion = 1.6
 envlist =
-    coala,
-    molecule
+    molecule,
+    pre-commit
 skipsdist=true
 
-[testenv:coala]
-basepython = python3
-deps =
-    coala
-    coala-bears
-commands =
-    python3 -m nltk.downloader punkt maxent_treebank_pos_tagger averaged_perceptron_tagger
-    coala --non-interactive
-
 [testenv:molecule]
 basepython = python2
 deps =
@@ -23,3 +14,9 @@ deps =
 passenv = *
 commands =
     ./molecule.sh
+
+[testenv:pre-commit]
+deps = pre-commit
+commands =
+    pre-commit install --hook-type commit-msg
+    pre-commit run --all-files
\ No newline at end of file