diff --git a/.travis.yml b/.travis.yml index 0c2ac28..3232600 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ install: env: - TOXENV=pep8 + - TOXENV=yamllint - TOXENV=py27 - TOXENV=py33 - TOXENV=py34 diff --git a/raml/api.raml b/raml/api.raml index f3f1e6c..3f22032 100644 --- a/raml/api.raml +++ b/raml/api.raml @@ -163,7 +163,6 @@ mediaType: application/json schema: !include schemas/200.json example: !include response_examples/200/status_health.json - /status/availability/{period}: uriParameters: period: @@ -177,7 +176,6 @@ mediaType: application/json schema: !include schemas/200.json example: !include response_examples/200/status_availability.json - /status/performance/{period}: uriParameters: period: diff --git a/tools/ramllint.sh b/tools/ramllint.sh new file mode 100755 index 0000000..e1d3aa4 --- /dev/null +++ b/tools/ramllint.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -ex + +workdir=$(dirname $0) +yamllint -c $workdir/ramllint.yaml $(find . -not -path '*/\.*' -type f -name '*.raml') diff --git a/tools/ramllint.yaml b/tools/ramllint.yaml new file mode 100644 index 0000000..d87c75d --- /dev/null +++ b/tools/ramllint.yaml @@ -0,0 +1,24 @@ +extends: default + +rules: + braces: + max-spaces-inside: 1 + comments: + level: error + require-starting-space: false + comments-indentation: + level: warning + document-end: + present: false + document-start: + level: error + present: false + empty-lines: + max: 1 + max-start: 0 + max-end: 0 + indentation: + spaces: consistent + line-length: + level: warning + max: 120 diff --git a/tools/yamllint.sh b/tools/yamllint.sh new file mode 100755 index 0000000..6e84445 --- /dev/null +++ b/tools/yamllint.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -ex + +workdir=$(dirname $0) +yamllint -c $workdir/yamllint.yaml $(find . -not -path '*/\.*' -type f -name '*.yaml') diff --git a/tools/yamllint.yaml b/tools/yamllint.yaml new file mode 100644 index 0000000..834dc06 --- /dev/null +++ b/tools/yamllint.yaml @@ -0,0 +1,23 @@ +extends: default + +rules: + braces: + max-spaces-inside: 1 + comments: + level: error + comments-indentation: + level: warning + document-end: + present: false + document-start: + level: error + present: false + empty-lines: + max: 1 + max-start: 0 + max-end: 0 + indentation: + spaces: consistent + line-length: + level: warning + max: 120 diff --git a/tox.ini b/tox.ini index 83e3b1b..20e0226 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] minversion = 1.6 skipsdist = True -envlist = py35,py34,py27,pep8 +envlist = py35,py34,py27,pep8,yamllint [testenv] setenv = VIRTUAL_ENV={envdir} @@ -40,6 +40,12 @@ basepython = python3.5 [testenv:venv] commands = {posargs} +[testenv:yamllint] +deps = yamllint +commands = + {toxinidir}/tools/yamllint.sh + {toxinidir}/tools/ramllint.sh + [flake8] ignore = H703 show-source = true