mirror of https://github.com/docker/compose.git
Add pre-commit hooks
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
parent
2da8b7e511
commit
fae6454661
|
@ -0,0 +1,18 @@
|
|||
- repo: git://github.com/pre-commit/pre-commit-hooks
|
||||
sha: 'v0.4.2'
|
||||
hooks:
|
||||
- id: check-added-large-files
|
||||
- id: check-docstring-first
|
||||
- id: check-merge-conflict
|
||||
- id: check-yaml
|
||||
- id: debug-statements
|
||||
- id: end-of-file-fixer
|
||||
- id: flake8
|
||||
- id: name-tests-test
|
||||
exclude: 'tests/integration/testcases.py'
|
||||
- id: requirements-txt-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: git://github.com/asottile/reorder_python_imports
|
||||
sha: 3d86483455ab5bd06cc1069fdd5ac57be5463f10
|
||||
hooks:
|
||||
- id: reorder-python-imports
|
|
@ -14,6 +14,7 @@ RUN set -ex; \
|
|||
curl \
|
||||
lxc \
|
||||
iptables \
|
||||
libsqlite3-dev \
|
||||
; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
@ -68,6 +69,8 @@ RUN pip install -r requirements.txt
|
|||
ADD requirements-dev.txt /code/
|
||||
RUN pip install -r requirements-dev.txt
|
||||
|
||||
RUN pip install tox==2.1.1
|
||||
|
||||
ADD . /code/
|
||||
RUN python setup.py install
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
set -e
|
||||
|
||||
>&2 echo "Running lint checks"
|
||||
flake8 compose tests setup.py
|
||||
tox -e pre-commit
|
||||
|
||||
if [ "$DOCKER_VERSIONS" == "" ]; then
|
||||
DOCKER_VERSIONS="default"
|
||||
|
|
12
tox.ini
12
tox.ini
|
@ -1,8 +1,10 @@
|
|||
[tox]
|
||||
envlist = py26,py27
|
||||
envlist = py27,pre-commit
|
||||
|
||||
[testenv]
|
||||
usedevelop=True
|
||||
passenv =
|
||||
LD_LIBRARY_PATH
|
||||
deps =
|
||||
-rrequirements.txt
|
||||
-rrequirements-dev.txt
|
||||
|
@ -10,6 +12,14 @@ commands =
|
|||
nosetests -v {posargs}
|
||||
flake8 compose tests setup.py
|
||||
|
||||
[testenv:pre-commit]
|
||||
skip_install = True
|
||||
deps =
|
||||
pre-commit
|
||||
commands =
|
||||
pre-commit install
|
||||
pre-commit run --all-files
|
||||
|
||||
[flake8]
|
||||
# ignore line-length for now
|
||||
ignore = E501,E203
|
||||
|
|
Loading…
Reference in New Issue