Skip to content

Commit

Permalink
Add yamllint for yaml and raml files
Browse files Browse the repository at this point in the history
  • Loading branch information
akscram committed Dec 15, 2016
1 parent c20312f commit b67ce56
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -5,6 +5,7 @@ install:

env:
- TOXENV=pep8
- TOXENV=yamllint
- TOXENV=py27
- TOXENV=py33
- TOXENV=py34
Expand Down
5 changes: 5 additions & 0 deletions 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')
24 changes: 24 additions & 0 deletions 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
5 changes: 5 additions & 0 deletions 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')
23 changes: 23 additions & 0 deletions 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
8 changes: 7 additions & 1 deletion 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}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b67ce56

Please sign in to comment.