feat: add pre-commit support (#543)

Co-authored-by: Douglas Thor <doug.thor@gmail.com>
This commit is contained in:
Robert Kaussow 2023-02-10 10:15:01 +01:00 committed by GitHub
parent f655603614
commit 106feff9ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 0 deletions

View File

@ -23,3 +23,4 @@ LINT([0-9]{4})
SCM SCM
bools bools
Check[A-Z].+ Check[A-Z].+
(P|p)re-(C|c)ommit

10
.pre-commit-hooks.yaml Normal file
View File

@ -0,0 +1,10 @@
---
- id: ansible-later
name: ansible-later
description: Run ansible-later, a best-practice scanner for Ansible.
entry: ansible-later
language: python
pass_filenames: False
always_run: True
additional_dependencies:
- .[ansible-core]

View File

@ -0,0 +1,21 @@
---
title: Pre-Commit setup
---
To use `ansible-later` with the [pre-commit](https://pre-commit.com/) framework, add the following to the `.pre-commit-config.yaml` file in your local repository.
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- spellchecker-disable -->
{{< highlight yaml "linenos=table" >}}
- repo: https://github.com/thegeeklab/ansible-later
# change ref to the latest release from https://github.com/thegeeklab/ansible-later/releases
rev: v3.0.2
hooks:
- id: ansible-later
{{< /highlight >}}
<!-- spellchecker-enable -->
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->