From f0358c18aa5e1f6d2cdbfabb67e434c566df197d Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Sat, 31 Oct 2020 11:52:56 +0100 Subject: [PATCH] Fix a little. --- files/pre-commit | 4 ---- files/pre-commit-config.yaml | 20 ++++++++++++++++++++ generate.yml | 19 ++++++++----------- 3 files changed, 28 insertions(+), 15 deletions(-) delete mode 100644 files/pre-commit create mode 100644 files/pre-commit-config.yaml diff --git a/files/pre-commit b/files/pre-commit deleted file mode 100644 index 69bdc26..0000000 --- a/files/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/sh - -yamllint . -ansible-lint diff --git a/files/pre-commit-config.yaml b/files/pre-commit-config.yaml new file mode 100644 index 0000000..4bc6512 --- /dev/null +++ b/files/pre-commit-config.yaml @@ -0,0 +1,20 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-added-large-files + + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.17.0 + hooks: + - id: yamllint + args: [-c=.yamllint] + + - repo: https://github.com/ansible/ansible-lint.git + rev: v4.3.5 + hooks: + - id: ansible-lint + pass_filenames: false diff --git a/generate.yml b/generate.yml index de71533..35b941e 100755 --- a/generate.yml +++ b/generate.yml @@ -153,17 +153,15 @@ when: travis_secure.stdout is defined - - name: create .github directory + - name: create .github directories file: - path: "{{ role_path }}/.github" - state: directory - mode: "0755" - - - name: create .github/workflows directory - file: - path: "{{ role_path }}/.github/workflows" + path: "{{ role_path }}/{{ item }}" state: directory mode: "0755" + loop: + - .github + - .github/workflows + - .github/ISSUE_TEMPLATE - name: copy file copy: @@ -181,9 +179,8 @@ dest: .yamllint - source: FUNDING.yml dest: .github/FUNDING.yml - - source: pre-commit - dest: .git/hooks/pre-commit - mode: "0755" + - source: pre-commit-config.yaml + dest: .pre-commit-config.yaml loop_control: label: "{{ item.source }}"