From 504be6872943017bc446c127497d53094aba1f5f Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Tue, 17 Jul 2018 21:28:53 -0400 Subject: [PATCH] Add pre-commit hook for trailing-whitespace Install using tox: tox -e check-hooks ref: https://pre-commit.com Change-Id: Ie7882b59f1817708b5365cb0490e644d3a411b93 Signed-off-by: Thanh Ha --- .pre-commit-config.yaml | 6 ++++++ tox.ini | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ce05348 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v1.3.0 + hooks: + - id: trailing-whitespace diff --git a/tox.ini b/tox.ini index 5677326..e6e3ae4 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ minversion = 1.6 envlist = check-best-practices, + check-hooks, coala, docs, docs-linkcheck @@ -10,6 +11,12 @@ skipsdist=true [testenv:check-best-practices] commands = python {toxinidir}/check-best-practices.py +[testenv:check-hooks] +deps = pre-commit +commands = + pre-commit install + pre-commit run --all-files + [testenv:coala] basepython = python3 deps = -- 2.16.6