From 058bf55bf274a57d84b9782990edfe5f581934bb Mon Sep 17 00:00:00 2001 From: "Grayson, Matthew" Date: Fri, 8 Mar 2024 14:06:36 -0600 Subject: [PATCH 1/3] Comment out pre-commit hooks for Packer and Ansible with justification. --- .pre-commit-config.yaml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 34f02530..9f1efdd6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -135,12 +135,14 @@ repos: hooks: - id: pyupgrade - # Ansible hooks - - repo: https://github.com/ansible/ansible-lint - rev: v6.19.0 - hooks: - - id: ansible-lint - # files: molecule/default/playbook.yml +# # 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 +# files: molecule/default/playbook.yml # Terraform hooks - repo: https://github.com/antonbabenko/pre-commit-terraform @@ -155,9 +157,10 @@ repos: hooks: - id: docker-compose-check - # Packer hooks - - repo: https://github.com/cisagov/pre-commit-packer - rev: v0.0.2 - hooks: - - id: packer_validate - - id: packer_fmt +# # 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 From 79220b9de1a383128a76248d4f3420e037c603cc Mon Sep 17 00:00:00 2001 From: "Grayson, Matthew" Date: Mon, 11 Mar 2024 12:50:20 -0500 Subject: [PATCH 2/3] 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 From 5e905d164774323d9e4c4cd9e807b24ef5454e9f Mon Sep 17 00:00:00 2001 From: "Grayson, Matthew" Date: Tue, 12 Mar 2024 09:38:43 -0500 Subject: [PATCH 3/3] Remove pre-commit hooks for ansible/packer; delete .ansible-lint config file. --- .ansible-lint | 28 ---------------------------- .pre-commit-config.yaml | 14 -------------- 2 files changed, 42 deletions(-) delete mode 100644 .ansible-lint diff --git a/.ansible-lint b/.ansible-lint deleted file mode 100644 index 711c123c..00000000 --- a/.ansible-lint +++ /dev/null @@ -1,28 +0,0 @@ ---- -# See https://ansible-lint.readthedocs.io/configuring/ for a list of -# the configuration elements that can exist in this file. -enable_list: - # Useful checks that one must opt-into. See here for more details: - # https://ansible-lint.readthedocs.io/rules/ - - fcqn-builtins - - no-log-password - - no-same-owner -exclude_paths: - # This exclusion is implicit, unless exclude_paths is defined - - .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 - # configuration in ansible-lint for molecule configurations: - # yaml: "**/molecule/*/{base,molecule}.{yaml,yml}" - - yaml: "**/molecule/*/molecule-{no,with}-systemd.yml" -use_default_rules: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0fc86d7b..f44dd940 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -135,13 +135,6 @@ repos: hooks: - id: pyupgrade - # Ansible hooks - - repo: https://github.com/ansible/ansible-lint - rev: v6.19.0 - hooks: - - id: ansible-lint -# files: molecule/default/playbook.yml - # Terraform hooks - repo: https://github.com/antonbabenko/pre-commit-terraform rev: v1.83.2 @@ -154,10 +147,3 @@ repos: rev: v3.0.1 hooks: - id: docker-compose-check - - # Packer hooks - - repo: https://github.com/cisagov/pre-commit-packer - rev: v0.0.2 - hooks: - - id: packer_validate - - id: packer_fmt