From f9f6cb0c2ba5cc6de60d281444b3976530d8aa5a Mon Sep 17 00:00:00 2001 From: Jeffrey van Pelt Date: Tue, 23 May 2023 17:12:21 +0200 Subject: [PATCH 1/3] Added pre-commit hook --- .pre-commit-hooks.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..39fb415 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,13 @@ +--- +# For use with pre-commit. +# See usage instructions at http://pre-commit.com + +- id: ansible-lint + name: Ansible-lint + description: This hook runs ansible-lint. + entry: python3 -m ansible_sign.cli project gpg-sign . + language: python + # do not pass files to ansible-lint, see: + # https://github.com/ansible/ansible-lint/issues/611 + pass_filenames: false + always_run: true From edce7d71323dd026eb87106c52432127e7aab790 Mon Sep 17 00:00:00 2001 From: Jeffrey van Pelt Date: Tue, 23 May 2023 17:21:24 +0200 Subject: [PATCH 2/3] Update hook --- .pre-commit-hooks.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 39fb415..5ce12fb 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -2,10 +2,10 @@ # For use with pre-commit. # See usage instructions at http://pre-commit.com -- id: ansible-lint - name: Ansible-lint - description: This hook runs ansible-lint. - entry: python3 -m ansible_sign.cli project gpg-sign . +- id: ansible-sign + name: Ansible-sign + description: This hook runs ansible-sign. + entry: ansible-sign project gpg-sign . language: python # do not pass files to ansible-lint, see: # https://github.com/ansible/ansible-lint/issues/611 From 36ed33aa8bd1e388271713861b3ea520aca54c84 Mon Sep 17 00:00:00 2001 From: Jeffrey van Pelt Date: Tue, 30 May 2023 09:26:45 +0200 Subject: [PATCH 3/3] Cahnged hook to verify, as pre-commit does not accept changed-files --- .pre-commit-hooks.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 5ce12fb..b1db0cc 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -3,11 +3,10 @@ # See usage instructions at http://pre-commit.com - id: ansible-sign - name: Ansible-sign + name: Verify Ansible-sign signature description: This hook runs ansible-sign. - entry: ansible-sign project gpg-sign . + entry: ansible-sign project gpg-verify . language: python - # do not pass files to ansible-lint, see: - # https://github.com/ansible/ansible-lint/issues/611 + # do not pass files as we need to scan the directory with the MANIFEST.in pass_filenames: false always_run: true