Commit d46d9b6a authored by nimrod's avatar nimrod
Browse files

A plethora of small updates.

- Update Ansible.
- More pre-commit checks.
- Replace the Vault shell script with a simpler grep hook.
parent 3f6663a8
Loading
Loading
Loading
Loading
+23 −12
Original line number Diff line number Diff line
# vim:ff=unix ts=2 sw=2 ai expandtab
---
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v1.4.0
    rev: v2.5.0
    hooks:
      - id: check-added-large-files
    -   id: check-yaml
      - id: check-merge-conflict
    -   id: flake8
-   repo: https://www.shore.co.il/git/shell-pre-commit/
    rev: v0.6.0
      - id: detect-private-key
      - id: trailing-whitespace
  - repo: https://github.com/Lucas-C/pre-commit-hooks-markup
    rev: v1.0.0
    hooks:
    -   id: shell-lint
        files: ansible-vault-check
      - id: rst-linter
  - repo: https://github.com/adrienverge/yamllint
    rev: v1.21.0
    hooks:
      - id: yamllint
  - repo: https://github.com/amperser/proselint/
    rev: 0.10.2
    hooks:
      - id: proselint
        types: [plain-text]
        exclude: LICENSE|requirements

.pre-commit-hooks.yaml

deleted120000 → 0
+15 −1
Original line number Diff line number Diff line
hooks.yaml
 No newline at end of file

.pre-commit-hooks.yaml

0 → 100644
+15 −1
Original line number Diff line number Diff line
---
- id: ansible-syntax-check
  name: Syntax check Ansible playbooks
  description: Check Ansible playbooks for syntax errors.
  language: python
  entry: ansible-playbook
  files: playbook.yml
  args: ['--inventory=localhost,', '--syntax-check']
- id: ansible-vault-check
  name: Verify vaulted files
  description: Verify that Ansible Vault files are vaulted.
  language: pygrep
  files: vault
  entry: |-
      ANSIBLE_VAULT
+7 −1
Original line number Diff line number Diff line
---
language: python
python: ["2.7", "3.4", "3.5", "3.6"]
python:
  - "2.7"
  - "3.4"
  - "3.5"
  - "3.6"
  - "3.7"
  - "3.8"
dist: trusty
sudo: false
group: beta
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ Ansible `pre-commit <http://pre-commit.com/>`_ hooks.
Requirements
------------

- Pre-commit.
- Pre-commit 1.2 or later.
- Python 2.7 or 3.4 or later.

Installation
@@ -25,7 +25,7 @@ Add the following to your :code:`.pre-commit-config.yaml`:
.. code:: yaml

    - repo: https://www.shore.co.il/git/ansible-pre-commit/
      sha: v0.6.0
      sha: v0.9.0
      hooks:
      - id: ansible-syntax-check
        files: site.yml #In case you want to specify other playbook files.
Loading