From f6d9ff4196d3b0ad7e5e3bf72d6446b97a658c4a Mon Sep 17 00:00:00 2001 From: Max Gautier Date: Tue, 21 May 2024 20:57:06 +0200 Subject: [PATCH] Switch to upstream ansible-lint pre-commit hook This way, the hook is self contained and does not depend on a previous virtualenv installation. --- .pre-commit-config.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ec011eaa9..81a2ebf45 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,16 +35,18 @@ repos: exclude: "^.git" files: "\\.sh$" - - repo: local + - repo: https://github.com/ansible/ansible-lint + rev: v24.5.0 hooks: - id: ansible-lint - name: ansible-lint - entry: ansible-lint -v - language: python - pass_filenames: false additional_dependencies: - - .[community] + - ansible==9.5.1 + - jsonschema==4.22.0 + - jmespath==1.0.1 + - netaddr==1.2.1 + - repo: local + hooks: - id: ansible-syntax-check name: ansible-syntax-check entry: env ANSIBLE_INVENTORY=inventory/local-tests.cfg ANSIBLE_REMOTE_USER=root ANSIBLE_BECOME="true" ANSIBLE_BECOME_USER=root ANSIBLE_VERBOSITY="3" ansible-playbook --syntax-check