diff --git a/.gitignore b/.gitignore index a4889d1..080cb6c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ tab* +.tox diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..e688987 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,3 @@ +{ + "esversion": 6 +} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a513197 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,35 @@ +- repo: git://github.com/pre-commit/pre-commit-hooks.git + sha: 6b1aa19425b35f8c34f43ada8f1045b028dc19a5 + hooks: + - id: autopep8-wrapper + args: + - --in-place + - --aggressive + - --aggressive + - --max-line-length=131 + - id: check-ast + - id: check-case-conflict + - id: check-docstring-first + - id: check-json + files: \.(jshintrc|json)$ + - id: debug-statements + - id: double-quote-string-fixer + - id: end-of-file-fixer + - id: fix-encoding-pragma + - id: flake8 + args: + - --max-line-length=131 + - --ignore=E126,E128,E731 + - id: pretty-format-json + args: + - --autofix + - --indent + - '4' + - id: requirements-txt-fixer + - id: trailing-whitespace +- repo: git://github.com/pre-commit/mirrors-jshint + sha: 431358a85a3084cb86d731f2cd46490ec04f5c69 + hooks: + - id: jshint + args: + - --config=.jshintrc diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..be6473c --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +.PHONY: pre-commit clean test + +pre-commit: + @tox -e pre-commit -- install -f --install-hooks + +test: pre-commit + @tox -e pre-commit -- run --all-files + @tox + +clean: + @rm -fr .tox + @find . -name '*.py[co]' -delete + @find . -name '__pycache__' -delete diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..2429b9b --- /dev/null +++ b/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py27,py35 +skipsdist = true + +[testenv:pre-commit] +deps = + pre-commit +commands = + pre-commit {posargs}