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

Support running Copywrite as a pre-commit hook via .pre-commit-hooks.yaml #24

Merged
merged 4 commits into from Feb 2, 2023

Conversation

CalebAlbers
Copy link
Member

@CalebAlbers CalebAlbers commented Feb 2, 2023

🛠️ Description

Fixes #8

Adds a .pre-commit-hooks.yaml file, defining a set of four common hooks that can be used to validate or add headers and the LICENSE file. This empowers people to run the copywrite tooling as part of their regular pre-commit workflow.

Side note on technical implementation - I decided to try using the golang language support, in which pre-commit will automatically setup a Go environment, clone this repo, and use go run . as the entry. Ideally, we'd use the native copywrite binaries, but that would require anyone using the hooks to have bootstrapped their environment before-hand. This can always be adjusted or changed in the future.

⚠️ Tag v0.15.0 is for a pending release, which will need to be created after this is merged.

🔗 External Links

https://hashicorp.atlassian.net/browse/ENGSYS2-534

🤔 Can be merged upon approval?

@CalebAlbers CalebAlbers requested a review from a team February 2, 2023 01:17
@CalebAlbers CalebAlbers changed the title Add .pre-commit-hooks.yaml / support multiple hooks Support running Copywrite as a pre-commit hook via .pre-commit-hooks.yaml Feb 2, 2023
@CalebAlbers CalebAlbers mentioned this pull request Feb 2, 2023
@CalebAlbers CalebAlbers merged commit 66e5399 into main Feb 2, 2023
@CalebAlbers CalebAlbers deleted the pre-commit-hooks branch February 2, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pre-Commit Hook
2 participants