Skip to content

Commit c152f81

Browse files
authored
Merge pull request #661 from hashicorp/add-makefile
Add make targets for common checks + fixes
2 parents 76bf60b + 3cf7572 commit c152f81

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
fmtcheck:
2+
"$(CURDIR)/scripts/gofmtcheck.sh"
3+
4+
fmtfix:
5+
gofmt -w ./
6+
7+
vetcheck:
8+
go vet ./...
9+
10+
copyrightcheck:
11+
go run github.com/hashicorp/copywrite@latest headers --plan
12+
13+
copyrightfix:
14+
go run github.com/hashicorp/copywrite@latest headers
15+
16+
check: copyrightcheck vetcheck fmtcheck
17+
18+
fix: copyrightfix fmtfix

scripts/gofmtcheck.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) HashiCorp, Inc.
3+
# SPDX-License-Identifier: MPL-2.0
4+
5+
if [[ -n $(gofmt -l ./) ]]; then echo "Please run gofmt -w ./ to format code"; exit 1; fi;

0 commit comments

Comments
 (0)