forked from hashicorp/terraform-plugin-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (38 loc) · 1.13 KB
/
Makefile
File metadata and controls
54 lines (38 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
GOFMT_FILES?=$$(find . -name '*.go')
VENV_BIN ?= python3 -m venv
VENV_DIR ?= .venv
PIP_CMD ?= pip3
ifeq ($(OS), Windows_NT)
VENV_ACTIVATE = $(VENV_DIR)/Scripts/activate
else
VENV_ACTIVATE = $(VENV_DIR)/bin/activate
endif
VENV_RUN = . $(VENV_ACTIVATE)
$(VENV_ACTIVATE):
test -d $(VENV_DIR) || $(VENV_BIN) $(VENV_DIR)
touch $(VENV_ACTIVATE)
venv: $(VENV_ACTIVATE) ## Create a new (empty) virtual environment
default: test
test: generate
go test ./...
lint:
golangci-lint run
generate:
go generate ./...
cd tools; go generate ./...
fmt:
gofmt -s -w -e $(GOFMT_FILES)
# Run this if working on the website locally to run in watch mode.
website:
$(MAKE) -C website website
# Use this if you have run `website/build-local` to use the locally built image.
website/local:
$(MAKE) -C website website/local
# Run this to generate a new local Docker image.
website/build-local:
$(MAKE) -C website website/build-local
patch-install: venv
$(VENV_RUN); $(PIP_CMD) install --upgrade -r requirements.txt
patch-create-tags:
$(VENV_RUN); python create_all_tags.py
.PHONY: default fmt lint generate test website website/local website/build-local