Skip to content

Commit

Permalink
Add Makefile for common checks + fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Feb 16, 2024
1 parent 97cf603 commit d84f1b4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
fmtcheck:
"$(CURDIR)/scripts/gofmtcheck.sh"

fmtfix:
gofmt -w ./

vetcheck:
go vet ./...

# TODO: version copywrite via tools.go
copyrightcheck:
go run github.com/hashicorp/copywrite headers --plan

# TODO: version copywrite via tools.go
copyrightfix:
go run github.com/hashicorp/copywrite headers

check:
$(MAKE) -C copyrightcheck vetcheck fmtcheck

fix:
$(MAKE) -C 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 d84f1b4

Please sign in to comment.