From: Thanh Ha Date: Wed, 18 Jul 2018 01:28:53 +0000 (-0400) Subject: Add pre-commit hook for trailing-whitespace X-Git-Tag: v0.1.0~16^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=f1b6e5e03c6b0aa7a5ddb0c5eebe37a720e3df75;p=releng%2Fcommon-packer.git Add pre-commit hook for trailing-whitespace Install using tox: tox -e check-hooks ref: https://pre-commit.com Change-Id: I9e1716a486ae027cd9eb35b415ee700ad0bc60d9 Signed-off-by: Thanh Ha --- 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 aa8545a..95c7607 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,16 @@ [tox] minversion = 1.6 -envlist = coala +envlist = + check-hooks, + coala skipsdist = true +[testenv:check-hooks] +deps = pre-commit +commands = + pre-commit install + pre-commit run --all-files + [testenv:coala] basepython = python3 deps =