From d32f4e5a7b509228bff47640e89b1143f75b4fd2 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Fri, 21 Feb 2020 22:31:24 +0100 Subject: [PATCH] molecule/tox: Support yamllint without molecule With molecule v3, the linter config needs to be changed. To prepare for this, run yamllint with tox as molecule would do it for V3. --- molecule/default/yamllint.yml => .yamllint.yml | 2 ++ molecule/default/molecule.yml | 2 +- tox.ini | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) rename molecule/default/yamllint.yml => .yamllint.yml (91%) diff --git a/molecule/default/yamllint.yml b/.yamllint.yml similarity index 91% rename from molecule/default/yamllint.yml rename to .yamllint.yml index 14e4519..ae5f8c0 100644 --- a/molecule/default/yamllint.yml +++ b/.yamllint.yml @@ -1,5 +1,7 @@ # SPDX-License-Identifier: MIT --- +ignore: | + /.tox/ extends: default rules: braces: diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 9d2105d..f3a6be1 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -7,7 +7,7 @@ driver: lint: name: yamllint options: - config-file: molecule/default/yamllint.yml + config-file: .yamllint.yml platforms: - name: centos-6 image: docker.io/linuxsystemroles/centos-6 diff --git a/tox.ini b/tox.ini index b7a90e9..24b509e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT [tox] envlist = - black, pylint, flake8, + black, pylint, flake8, yamllint py{26,27,36,37,38}, custom skipsdist = true @@ -161,6 +161,10 @@ whitelist_externals = commands = bash {toxinidir}/.travis/runflake8.sh {envpython} --statistics {posargs} . +[testenv:yamllint] +deps = yamllint +commands = yamllint . + [testenv:coveralls] envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:coveralls} passenv = TRAVIS TRAVIS_* @@ -265,6 +269,6 @@ python = 2.6: py26,custom 2.7: py27,flake8,pylint,custom 3.5: coveralls,custom - 3.6: py36,black,custom + 3.6: py36,black,yamllint,custom 3.7: py37,custom 3.8: py38,custom