-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #661 from hashicorp/add-makefile
Add make targets for common checks + fixes
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
fmtcheck: | ||
"$(CURDIR)/scripts/gofmtcheck.sh" | ||
|
||
fmtfix: | ||
gofmt -w ./ | ||
|
||
vetcheck: | ||
go vet ./... | ||
|
||
copyrightcheck: | ||
go run github.com/hashicorp/copywrite@latest headers --plan | ||
|
||
copyrightfix: | ||
go run github.com/hashicorp/copywrite@latest headers | ||
|
||
check: copyrightcheck vetcheck fmtcheck | ||
|
||
fix: copyrightfix fmtfix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
if [[ -n $(gofmt -l ./) ]]; then echo "Please run gofmt -w ./ to format code"; exit 1; fi; |