Skip to content

Commit d5cbd72

Browse files
committed
docs: Include the installation sources to the pre-commit script
1 parent c3641e2 commit d5cbd72

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

precommit_trial.sh

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ do
88
cd $i
99
go fmt
1010
go mod tidy
11+
# go install golang.org/x/tools/cmd/goimports@latest
1112
goimports -w .
1213
cd $current_dir
1314
done
@@ -21,30 +22,37 @@ echo "====Health & Standards===="
2122
go vet $(go list -m)
2223

2324
# Stricter linting
25+
# go install honnef.co/go/tools/cmd/staticcheck@latest
2426
staticcheck $(go list -m)
2527

2628
# Run Even stricter linting
29+
# go install -v github.com/go-critic/go-critic/cmd/gocritic@latest
2730
gocritic check $(go list -m)
2831

2932
echo "====Error handling===="
3033
# Identifies any non-exhaustive case statements
34+
# go install github.com/nishanths/exhaustive/cmd/exhaustive@latest
3135
exhaustive $(go list -m)
3236

3337
# Check for potential Nil panics
3438
# nilaway $(go list -m)
3539

3640
echo "====Performance===="
3741
# Identifies areas where pre-allocating slices could improve performance
42+
# go install github.com/alexkohler/prealloc@latest
3843
prealloc $(go list -m)
3944

4045
echo "====Maintainability===="
4146
# Detects frequently used strings which could be constants
47+
# go get github.com/jgautheron/goconst/cmd/goconst
4248
goconst -min-occurrences 5 ./...
4349

4450
# Identifies mixed pointer receivers to an interface
51+
# go install github.com/nikolaydubina/smrcptr@latest
4552
smrcptr $(go list -m)
4653

4754
echo "====Complexity===="
4855
# Limit Cognitive complexity
56+
# go install github.com/jgautheron/goconst/cmd/goconst@latest
4957
gocognit -over 15 -top 10 $(go list -m -f '{{.Dir}}')
5058

0 commit comments

Comments
 (0)