Skip to content

Commit 4f929f8

Browse files
authored
unhack: add pre-commit guidelines (hashicorp#19617)
1 parent da8700f commit 4f929f8

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.pre-commit-config.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,29 @@
33

44
# See https://pre-commit.com for more information
55
# See https://pre-commit.com/hooks.html for more hooks
6+
#
7+
# Opt-in to running pre-commit hooks by running `make tools`.
8+
#
9+
# Guidelines for adding new pre-commit hooks
10+
# ====================================================================
11+
# A hook SHOULD be blazingly fast (<2s) to impose minimal latency on
12+
# developer workflows (e.g. golangci-lint takes > 8s)
13+
#
14+
# A hook SHOULD attempt to fix errors, not just identify them.
15+
#
16+
# A hook SHOULD address common errors in files that tend to change
17+
# frequently. While surfacing esoteric issues is nice, hooks that have a
18+
# wider impact are preferred.
19+
#
620
repos:
721
- repo: https://github.com/tekwizely/pre-commit-golang
822
rev: v1.0.0-rc.1
923
hooks:
10-
# Formats go imports into deterministic sections
11-
# `pre-commit run gci` to run in isolation
24+
# Formats go imports into deterministic sections.
25+
# `pre-commit run gci` to run in isolation.
1226
- id: my-cmd
13-
name: gci
27+
name: Format go imports
28+
alias: gci
1429
# skip all generated go files
1530
exclude: |
1631
(?x)(
@@ -36,4 +51,4 @@ repos:
3651
- "--section"
3752
- "prefix(github.com/hashicorp/)"
3853
- "--section"
39-
- "prefix(github.com/hashicorp/consul/)"
54+
- "prefix(github.com/hashicorp/consul/)"

0 commit comments

Comments
 (0)