Commit 516fab4c authored by nimrod's avatar nimrod
Browse files

- Moved the flake8 section from setup.cfg to tox.ini (more appropriate).

- Updated pre-commit hooks, added shellcheck.
- Corrected issues in test.sh found by shellcheck.
- Added bandit and pre-commit to the usual (local) Tox run.
parent ef78c2d9
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
-   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
+0 −4
Original line number Diff line number Diff line
[bdist_wheel]
universal=1

[flake8]
exclude = .tox,*.egg,build,data
select = E,W,F
+5 −4
Original line number Diff line number Diff line
#!/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"
+5 −1
Original line number Diff line number Diff line
[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