From 79220b9de1a383128a76248d4f3420e037c603cc Mon Sep 17 00:00:00 2001 From: "Grayson, Matthew" Date: Mon, 11 Mar 2024 12:50:20 -0500 Subject: [PATCH] Uncomment pre-commit hooks for ansible/packer; add exclude_paths to .ansible-lint. --- .ansible-lint | 7 +++++++ .pre-commit-config.yaml | 25 +++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 4ffc0efa..711c123c 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -12,6 +12,13 @@ exclude_paths: - .cache # Seems wise to ignore this too - .github + # Ignore all dependency directories and functions.yml + - node_modules + - backend/node_modules + - backend/src/tasks + - docs/node_modules + - frontend/node_modules + - frontend/scripts/node_modules kinds: # This will force our systemd specific molecule configurations to be treated # as plain yaml files by ansible-lint. This mirrors the default kind diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f1efdd6..0fc86d7b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -135,13 +135,11 @@ repos: hooks: - id: pyupgrade -# # Ansible hooks -# This hook takes several minutes checking .yml files outside our version control and -# there are no ansible playbooks in this repository -# - repo: https://github.com/ansible/ansible-lint -# rev: v6.19.0 -# hooks: -# - id: ansible-lint + # Ansible hooks + - repo: https://github.com/ansible/ansible-lint + rev: v6.19.0 + hooks: + - id: ansible-lint # files: molecule/default/playbook.yml # Terraform hooks @@ -157,10 +155,9 @@ repos: hooks: - id: docker-compose-check -# # Packer hooks -# This hook fails and there are no packer files in this repository -# - repo: https://github.com/cisagov/pre-commit-packer -# rev: v0.0.2 -# hooks: -# - id: packer_validate -# - id: packer_fmt + # Packer hooks + - repo: https://github.com/cisagov/pre-commit-packer + rev: v0.0.2 + hooks: + - id: packer_validate + - id: packer_fmt