Skip to content

Commit

Permalink
docs: update readme with new pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
artis3n committed Aug 14, 2021
1 parent ea412eb commit abed773
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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$
```

0 comments on commit abed773

Please sign in to comment.