jenkins-bot has submitted this change and it was merged. Change subject: Enable YAML linting via tox using yamllint ......................................................................
Enable YAML linting via tox using yamllint In f439ac4 we introduced a tox target to lint YAML files. This command iterates over all .yml files and tries loading them. The mechanism is here changed to using yamllint, enables this lint during the default tox run and extends it to all non-vendor .yml files. Change-Id: I38bbce4183f99da7ec225982835b460f70ec06b6 --- A .yamllint_cmd.sh M requirements-test.txt M tox.ini 3 files changed, 7 insertions(+), 4 deletions(-) Approvals: Lokal Profil: Looks good to me, approved jenkins-bot: Verified diff --git a/.yamllint_cmd.sh b/.yamllint_cmd.sh new file mode 100755 index 0000000..0d9e64e --- /dev/null +++ b/.yamllint_cmd.sh @@ -0,0 +1,2 @@ +#!/bin/sh +yamllint $(find ./ -type d \( -path ./vendor -o -path ./node_modules \) -prune -o -name '*.yml' -print ) diff --git a/requirements-test.txt b/requirements-test.txt index a11d47b..9f90b1c 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -4,3 +4,4 @@ nose nose-cov coverage +yamllint diff --git a/tox.ini b/tox.ini index 9a1e648..dc45a7a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,12 @@ [tox] -envlist = flake8,py27 +envlist = yaml,flake8,py27 skipsdist=true [testenv] setenv = PYWIKIBOT2_NO_USER_CONFIG = 1 deps = - -r{toxinidir}/requirements-test.txt + -r{toxinidir}/requirements-test.txt commands = nosetests {posargs} [testenv:flake8] @@ -14,9 +14,9 @@ commands = flake8 [testenv:yaml] -deps = PyYAML +deps = yamllint commands = - /bin/bash -c \'set -euo pipefail && find erfgoedbot/ -name "*.yml" | xargs python -c "import sys,yaml; [yaml.load(open(x)) for x in sys.argv[1:]];" \' + {toxinidir}/.yamllint_cmd.sh [flake8] exclude = .venv,.tox -- To view, visit https://gerrit.wikimedia.org/r/309844 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I38bbce4183f99da7ec225982835b460f70ec06b6 Gerrit-PatchSet: 4 Gerrit-Project: labs/tools/heritage Gerrit-Branch: master Gerrit-Owner: Jean-Frédéric <jeanfrederic.w...@gmail.com> Gerrit-Reviewer: Jean-Frédéric <jeanfrederic.w...@gmail.com> Gerrit-Reviewer: Lokal Profil <lokal.pro...@gmail.com> Gerrit-Reviewer: Multichill <maar...@mdammers.nl> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits