From f325f0dc4d34cb79e9c15813140db1e18ed2a185 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Wed, 20 Jun 2018 20:25:44 -0400 Subject: [PATCH] Add pre-commit hook for trailing-whitespace Install using tox: tox -e check-hooks ref: https://pre-commit.com Change-Id: Ie060a9d1c843ce3889df10535d0a87e41d4b4e76 Signed-off-by: Thanh Ha --- .pre-commit-config.yaml | 6 ++++++ tox.ini | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..ce053483 --- /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 2d4d91e6..c5578f70 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,14 @@ [tox] minversion = 1.6 -envlist = coala,jjb,jjb-compare-xml,license +envlist = check-hooks,coala,jjb,jjb-compare-xml,license skipsdist = true +[testenv:check-hooks] +deps = pre-commit +commands = + pre-commit install + pre-commit run --all-files + [testenv:coala] basepython = python3 deps = -- 2.16.6