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

pre-commit hook for formatting backend code #21682

Merged
merged 2 commits into from
Jul 10, 2023

Conversation

cipherboy
Copy link
Contributor

This adds/updates the pre-commit hook to add a backend format checking prior to commit, similar to the existing UI check.

This should reduce the number of PR authors (mostly, myself) who commit things without checking that fmt CI has passed... :-)

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Jul 7, 2023
Copy link
Contributor

@mpalmi mpalmi left a comment

Choose a reason for hiding this comment

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

Good idea!

@mpalmi mpalmi mentioned this pull request Jul 7, 2023
.hooks/pre-commit Outdated Show resolved Hide resolved
By taking a slight penalty with each commit, we can ensure that
contributors follow the format behavior by default (if they run hooks),
making accidental PRs without proper formatting less likely.
Additionally, fix gofmtcheck to align with the Makefile, fixing the
corresponding fmtcheck target for use with the hook.

Signed-off-by: Alexander Scheel <[email protected]>
Signed-off-by: Alexander Scheel <[email protected]>
@cipherboy cipherboy force-pushed the cipherboy-pre-commit-hook-for-formatting branch from 6f42a4a to a18206a Compare July 10, 2023 16:34
@cipherboy cipherboy enabled auto-merge (squash) July 10, 2023 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog pr/no-milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants