Skip to content

Commit

Permalink
Merge pull request #661 from hashicorp/add-makefile
Browse files Browse the repository at this point in the history
Add make targets for common checks + fixes
  • Loading branch information
radeksimko authored Feb 26, 2024
2 parents 76bf60b + 3cf7572 commit c152f81
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Makefile
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
5 changes: 5 additions & 0 deletions scripts/gofmtcheck.sh
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;

0 comments on commit c152f81

Please sign in to comment.