From 46a5847bc6d21be8d1901415dcb103bd17f879f5 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Wed, 20 Jul 2022 10:29:02 +0100 Subject: [PATCH] Consolidate how we run linters Ensure we use pre-commit as linter orchestrator as this ensures that we always use the same linter version. --- .pre-commit-config.yaml | 6 ++++++ tox.ini | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 29b8d6c69..d27d6654b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,3 +4,9 @@ repos: rev: v2.0.0 hooks: - id: flake8 + - repo: https://github.com/adrienverge/yamllint + rev: v1.27.1 + hooks: + - id: yamllint + args: + - --strict diff --git a/tox.ini b/tox.ini index b64f020a8..fa0868f4e 100644 --- a/tox.ini +++ b/tox.ini @@ -19,11 +19,10 @@ commands = pytest {posargs} [testenv:linters] description = Run code linters basepython = python3.8 +deps = + pre-commit commands= - flake8 --version - flake8 docs ansible_runner test - yamllint --version - yamllint -s . + pre-commit run -a [testenv:unit{,-py38,-py39,-py310}] description = Run unit tests