From c20312f4afb4365ee033094af09859980d4e6a90 Mon Sep 17 00:00:00 2001 From: Ilya Kharin Date: Thu, 15 Dec 2016 15:19:54 +0400 Subject: [PATCH 1/2] Fix blank lines in api.raml --- raml/api.raml | 2 -- 1 file changed, 2 deletions(-) diff --git a/raml/api.raml b/raml/api.raml index 6d84fbb..f9ee23a 100644 --- a/raml/api.raml +++ b/raml/api.raml @@ -150,7 +150,6 @@ mediaType: application/json schema: !include schemas/200.json example: !include response_examples/200/status_health.json - /status/availability/{period}: uriParameters: period: @@ -164,7 +163,6 @@ mediaType: application/json schema: !include schemas/200.json example: !include response_examples/200/status_availability.json - /status/performance/{period}: uriParameters: period: From b67ce5613445b0a1b77c840f6f39db9bb68d0c38 Mon Sep 17 00:00:00 2001 From: Ilya Kharin Date: Thu, 15 Dec 2016 15:19:04 +0400 Subject: [PATCH 2/2] Add yamllint for yaml and raml files --- .travis.yml | 1 + tools/ramllint.sh | 5 +++++ tools/ramllint.yaml | 24 ++++++++++++++++++++++++ tools/yamllint.sh | 5 +++++ tools/yamllint.yaml | 23 +++++++++++++++++++++++ tox.ini | 8 +++++++- 6 files changed, 65 insertions(+), 1 deletion(-) create mode 100755 tools/ramllint.sh create mode 100644 tools/ramllint.yaml create mode 100755 tools/yamllint.sh create mode 100644 tools/yamllint.yaml diff --git a/.travis.yml b/.travis.yml index d7c51a6..0371a8d 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/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