diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0de076a133c93daecd7cffcdd24effa5f5f22cbb..01ac0d96637354ea7c8e94d03ed568e4d9e0b248 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,13 @@ - repo: git://github.com/pre-commit/pre-commit-hooks - sha: v0.7.1 + sha: v0.8.0 hooks: - id: check-added-large-files - - id: check-json - - id: check-xml - id: check-yaml - id: check-merge-conflict - id: flake8 - id: check-symlinks - repo: https://www.shore.co.il/git/shell-pre-commit/ - sha: v0.5.3 + sha: v0.5.4 hooks: - id: shell-lint + - id: shellcheck diff --git a/setup.cfg b/setup.cfg index a26fcc24bd147f868446ba58689e63c691bfa671..3c6e79cf31da1c0433d2fa666bf50b53f6359f26 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,2 @@ [bdist_wheel] universal=1 - -[flake8] -exclude = .tox,*.egg,build,data -select = E,W,F diff --git a/tests.sh b/tests.sh index d329d33f939fd7cfe4975a21a033357c9b3c433b..a21f2727fc48499e59995d286e2eb6b55cfd33ee 100755 --- a/tests.sh +++ b/tests.sh @@ -1,17 +1,18 @@ #!/bin/sh set -eu -export infile="$(mktemp)" -export outfile="$(mktemp)" +infile="$(mktemp)" +outfile="$(mktemp)" +export infile outfile echo Basic test. export name='John' -test "$(echo 'Hello {{ name if name is defined else 'world' }}.' | template)" = "Hello John." +test "$(echo 'Hello {{ name if name is defined else "world" }}.' | template)" = "Hello John." echo Testing arguments and reading/ writing to file. echo '{{ name }}' > "$infile" export name='John' template --output "$outfile" "$infile" -test "$(cat $outfile)" = "$name" +test "$(cat "$outfile")" = "$name" rm "$infile" "$outfile" diff --git a/tox.ini b/tox.ini index 34b08a6fc11a19344bf0ead96baf42a3a3bfe25b..d2f1d88de7ff674b021a4aa79bc0824eee3a1b00 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{2,3} +envlist = py{2,3},docs,bandit,pre-commit [travis] python = @@ -53,3 +53,7 @@ commands = bandit --recursive ./ --exclude .tox/,build/,dist/,template.egg-info basepython = python deps = pre-commit commands = pre-commit run --all-files + +[flake8] +exclude = .tox,*.egg,build,data +select = E,W,F