feat: add pre-commit support (#449)

This commit is contained in:
Robert Kaussow 2023-02-10 19:56:00 +01:00 committed by GitHub
parent ffe18075c5
commit a50242e345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 0 deletions

View File

@ -9,3 +9,4 @@ xoxys
ansible-.+
toc
GPL-3.0
(P|p)re-(C|c)ommit

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

@ -0,0 +1,8 @@
---
- id: ansible-doctor
name: ansible-doctor
description: Create annotation based documentation for your Ansible roles.
entry: ansible-doctor -f
language: python
pass_filenames: False
always_run: True

View File

@ -100,3 +100,23 @@ ANSIBLE_DOCTOR_CUSTOM_HEADER=
ANSIBLE_DOCTOR_EXCLUDE_FILES=
ANSIBLE_DOCTOR_EXCLUDE_FILES=molecule/,files/**/*.py
```
## Pre-Commit setup
To use _ansible-doctor_ 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-doctor
# change ref to the latest release from https://github.com/thegeeklab/ansible-doctor/releases
rev: v1.4.8
hooks:
- id: ansible-doctor
{{< /highlight >}}
<!-- spellchecker-enable -->
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->