Skip to content

Commit

Permalink
Merge pull request #48 from cisagov/improvement/format_files_instead_…
Browse files Browse the repository at this point in the history
…of_checking

Change `packer_fmt` to write to files by default
  • Loading branch information
mcdonnnj authored Oct 18, 2024
2 parents d635a17 + 3c5ca8a commit 7361323
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
# Hooks should be listed alphabetically by id.
- args:
- -check
description: This hook runs `packer fmt` on appropriate files.
- description: This hook runs `packer fmt` on appropriate files.
entry: hooks/packer_fmt.sh
files: \.pkr(?:vars)?\.hcl$
id: packer_fmt
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ projects using [Packer](https://www.packer.io/).
### `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
This hook ensures that any `.pkr.hcl` or `.pkrvars.hcl` files are properly formatted
using the `packer fmt` command. The hook will update files by default, but that
behavior can be overridden by changing the arguments passed to the hook.

### `packer_validate` ###
Expand All @@ -34,7 +34,7 @@ against any directory that houses `.pkr.hcl` files.
```yaml
repos:
- repo: https://github.com/cisagov/pre-commit-packer
rev: v0.2.0
rev: v0.3.0
hooks:
- id: packer_fmt
- id: packer_validate
Expand Down
2 changes: 1 addition & 1 deletion config/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.0
0.3.0

0 comments on commit 7361323

Please sign in to comment.