Skip to content

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

Merged
CalebAlbers merged 4 commits into
mainfrom
pre-commit-hooks
Feb 2, 2023
Merged

Support running Copywrite as a pre-commit hook via .pre-commit-hooks.yaml#24
CalebAlbers merged 4 commits into
mainfrom
pre-commit-hooks

Conversation

@CalebAlbers
Copy link
Copy Markdown
Contributor

@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
abhijeetviswa pushed a commit that referenced this pull request May 20, 2025
Close security alert #24.
Close SECVULN-22923
@abhijeetviswa abhijeetviswa mentioned this pull request May 20, 2025
2 tasks
abhijeetviswa pushed a commit that referenced this pull request May 20, 2025
Close security alert #24.
Close SECVULN-22923.
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