Skip to content

Commit abed773

Browse files
committed
docs: update readme with new pre-commit hook
1 parent ea412eb commit abed773

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ Since it doesn't make sense to only provide `opa test` with the files changed (a
4444
args: ['my/policies', 'my/other/policies/']
4545
```
4646

47+
#### `conftest-fmt`
48+
Runs `conftest fmt` on any Rego files in the repository.
49+
50+
Note that any files changed by this hook will need to be re-added (`git add`) to be included in the commit.
51+
4752
#### `conftest-test`
4853
Runs `conftest test` on any configuration file format supported by conftest.
4954

@@ -57,3 +62,11 @@ Just like with `opa-test` you'll likely want to specify the location of your con
5762

5863
#### `conftest-verify`
5964
If rego files are present in commit, runs `conftest verify` in git root directory.
65+
66+
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:
67+
68+
```yaml
69+
- id: conftest-verify
70+
args: ['--policy', 'conftest/policy']
71+
files: conftest/.*\.yaml$
72+
```

0 commit comments

Comments
 (0)