diff --git a/.dictionary b/.dictionary index 3a26823..46d753b 100644 --- a/.dictionary +++ b/.dictionary @@ -23,3 +23,4 @@ LINT([0-9]{4}) SCM bools Check[A-Z].+ +(P|p)re-(C|c)ommit diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..036b3ad --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -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] diff --git a/docs/content/configuration/pre-commit.md b/docs/content/configuration/pre-commit.md new file mode 100644 index 0000000..f56108e --- /dev/null +++ b/docs/content/configuration/pre-commit.md @@ -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. + + + + + +{{< 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 >}} + + + +