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

Run packer fmt on directories instead of files #56

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

mcdonnnj
Copy link
Member

🗣 Description

This pull request updates the packer_fmt hook to run against unique directory paths instead of individual files.

💭 Motivation and context

So it turns out that when you provide a directory to packer fmt it will format any applicable file within that directory. This is, in my opinion, a cleaner approach to leverage instead of running against each individual file.

🧪 Testing

Automated tests pass. I verified this works in a testing template.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

It turns out that you can run `packer fmt` on a path and it will check
any applicable files if that path is a directory. It makes sense to use
that functionality in the packer_fmt hook instead of running it against
each individual file.
@mcdonnnj mcdonnnj added the improvement This issue or pull request will add or improve functionality, maintainability, or ease of use label Dec 17, 2024
@mcdonnnj mcdonnnj requested a review from a team December 17, 2024 20:42
@mcdonnnj mcdonnnj self-assigned this Dec 17, 2024
@mcdonnnj mcdonnnj changed the title Run packer fmt on paths instead of files Run packer fmt on directories instead of files Dec 17, 2024
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍

@mcdonnnj mcdonnnj merged commit b8e2684 into develop Dec 17, 2024
4 checks passed
@mcdonnnj mcdonnnj deleted the improvement/run_packer_fmt_on_directories branch December 17, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants