Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hook documentation #42

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,23 @@ projects using [Packer](https://www.packer.io/).

## Available Hooks ##

| Hook name | Description |
| ----------------- | ------------------------------------------------------- |
| `packer_fmt` | Check that Packer HCL templates are properly formatted. |
| `packer_validate` | Validate all Packer templates. |
> [!NOTE]
> You can pass arguments to these hooks through the normal use of the `args` block
> in your pre-commit configuration. These arguments should align with whatever options
> you wish to pass to the underlying `packer` command. However, any arguments that
> take values must be in the form `-argument=value` rather than `-argument value`
> to ensure proper processing.

### `packer_fmt` ###

This hook checks that any `.pkr.hcl` or `.pkrvars.hcl` files are properly formatted
using the `packer fmt` command. The hook will only check files by default, but that
behavior can be overridden by changing the arguments passed to the hook.

### `packer_validate` ###

This hook checks that a Packer configuration is valid by running `packer validate`
against any directory that houses `.pkr.hcl` files.

## Usage ##

Expand Down
Loading