mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-24 13:50:41 +00:00
feat: add pre-commit support (#543)
Co-authored-by: Douglas Thor <doug.thor@gmail.com>
This commit is contained in:
parent
f655603614
commit
106feff9ba
@ -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
10
.pre-commit-hooks.yaml
Normal 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]
|
21
docs/content/configuration/pre-commit.md
Normal file
21
docs/content/configuration/pre-commit.md
Normal 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 -->
|
Loading…
Reference in New Issue
Block a user