From abed77356d39d3249e20e63d6f4906a095addbdb Mon Sep 17 00:00:00 2001 From: Ari Kalfus Date: Sat, 14 Aug 2021 10:31:45 -0400 Subject: [PATCH] docs: update readme with new pre-commit hook --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 15f8243..6112c23 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,11 @@ Since it doesn't make sense to only provide `opa test` with the files changed (a args: ['my/policies', 'my/other/policies/'] ``` +#### `conftest-fmt` +Runs `conftest fmt` on any Rego files in the repository. + +Note that any files changed by this hook will need to be re-added (`git add`) to be included in the commit. + #### `conftest-test` Runs `conftest test` on any configuration file format supported by conftest. @@ -57,3 +62,11 @@ Just like with `opa-test` you'll likely want to specify the location of your con #### `conftest-verify` If rego files are present in commit, runs `conftest verify` in git root directory. + +Just like with `conftest-test` you'll likely want to specify the location of your conftest policies, and possibly what type of files changed should trigger the hook: + +```yaml +- id: conftest-verify + args: ['--policy', 'conftest/policy'] + files: conftest/.*\.yaml$ +```