Skip to content

Commit 38a2908

Browse files
committed
help texts
1 parent f90f9b6 commit 38a2908

File tree

1 file changed

+25
-29
lines changed

1 file changed

+25
-29
lines changed

Makefile

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,18 @@ default: build
2626

2727
.PHONY: help
2828
help:
29-
@grep -h -E '^[a-zA-Z_-]+:.*?$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
29+
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | sort
3030

3131
.PHONY: build
32-
build: fmt fmtcheck
32+
build: fmt fmtcheck ## Generate the binary in ./bin
3333
go build -ldflags "$(LINKER_FLAGS)" -o $(DESTINATION)
3434

35-
.PHONY: install
36-
install: fmtcheck
37-
go install -ldflags="$(LINKER_FLAGS)"
38-
3935
.PHONY: test
40-
test: fmtcheck
36+
test: fmtcheck ## Run unit tests
4137
go test ./... -timeout=30s -parallel=4 -race
4238

4339
.PHONY: testmact
44-
testmact:
40+
testmact: ## Run MacT tests (mocked acc tests)
4541
@$(eval ACCTEST_REGEX_RUN?=^TestAccMockable)
4642
@$(eval export HTTP_MOCKER_REPLAY?=true)
4743
@$(eval export HTTP_MOCKER_CAPTURE?=false)
@@ -55,7 +51,7 @@ testmact:
5551
TF_ACC=1 go test $(ACCTEST_PACKAGES) -run '$(ACCTEST_REGEX_RUN)' -v -parallel $(PARALLEL_GO_TEST) $(TESTARGS) -timeout $(ACCTEST_TIMEOUT) -ldflags="$(LINKER_FLAGS)"
5652

5753
.PHONY: testmact-capture
58-
testmact-capture:
54+
testmact-capture: ## Capture HTTP traffic for MacT tests
5955
@$(eval export ACCTEST_REGEX_RUN?=^TestAccMockable)
6056
@$(eval export HTTP_MOCKER_REPLAY?=false)
6157
@$(eval export HTTP_MOCKER_CAPTURE?=true)
@@ -66,16 +62,16 @@ testmact-capture:
6662
TF_ACC=1 go test $(ACCTEST_PACKAGES) -run '$(ACCTEST_REGEX_RUN)' -v -parallel $(PARALLEL_GO_TEST) $(TESTARGS) -timeout $(ACCTEST_TIMEOUT) -ldflags="$(LINKER_FLAGS)"
6763

6864
.PHONY: testacc
69-
testacc: fmtcheck
65+
testacc: fmtcheck ## Run acc & mig tests (acceptance & migration tests)
7066
@$(eval ACCTEST_REGEX_RUN?=^TestAcc)
7167
TF_ACC=1 go test $(ACCTEST_PACKAGES) -run '$(ACCTEST_REGEX_RUN)' -v -parallel $(PARALLEL_GO_TEST) $(TESTARGS) -timeout $(ACCTEST_TIMEOUT) -ldflags="$(LINKER_FLAGS)"
7268

7369
.PHONY: testaccgov
74-
testaccgov: fmtcheck
70+
testaccgov: fmtcheck ## Run Government cloud-provider acc & mig tests
7571
TF_ACC=1 go test ./... -run 'TestAccProjectRSGovProject_CreateWithProjectOwner' -v -parallel 1 "$(TESTARGS) -timeout $(ACCTEST_TIMEOUT) -ldflags=$(LINKER_FLAGS) "
7672

7773
.PHONY: fmt
78-
fmt:
74+
fmt: ## Format Go code
7975
@echo "==> Fixing source code with gofmt..."
8076
gofmt -s -w .
8177

@@ -84,7 +80,7 @@ fmtcheck: ## Currently required by tf-deploy compile
8480
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
8581

8682
.PHONY: lint-fix
87-
lint-fix:
83+
lint-fix: ## Fix Go linter issues
8884
@echo "==> Fixing linters errors..."
8985
fieldalignment -json -fix ./...
9086
golangci-lint run --fix
@@ -95,7 +91,7 @@ lint:
9591
golangci-lint run
9692

9793
.PHONY: tools
98-
tools: ## Install dev tools
94+
tools: ## Install the dev tools (dependencies)
9995
@echo "==> Installing dependencies..."
10096
go telemetry off # disable sending telemetry data, more info: https://go.dev/doc/telemetry
10197
go install github.com/icholy/gomajor@latest
@@ -111,57 +107,57 @@ tools: ## Install dev tools
111107
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION)
112108

113109
.PHONY: docs
114-
docs:
110+
docs: ## Give URL to test Terraform documentation
115111
@echo "Use this site to preview markdown rendering: https://registry.terraform.io/tools/doc-preview"
116112

117113
.PHONY: tflint
118-
tflint: fmtcheck
114+
tflint: fmtcheck ## Linter for Terraform files
119115
tflint -f compact --recursive --minimum-failure-severity=warning
120116

121117
.PHONY: tf-validate
122-
tf-validate: fmtcheck
118+
tf-validate: fmtcheck ## Validate Terraform files
123119
scripts/tf-validate.sh
124120

125121
.PHONY: link-git-hooks
126-
link-git-hooks: ## Install git hooks
122+
link-git-hooks: ## Install Git hooks
127123
@echo "==> Installing all git hooks..."
128124
find .git/hooks -type l -exec rm {} \;
129125
find .githooks -type f -exec ln -sf ../../{} .git/hooks/ \;
130126

131127
.PHONY: update-atlas-sdk
132-
update-atlas-sdk: ## Update the atlas-sdk dependency
128+
update-atlas-sdk: ## Update the Atlas SDK dependency
133129
./scripts/update-sdk.sh
134130

135131
# e.g. run: make scaffold resource_name=streamInstance type=resource
136132
# - type argument can have the values: `resource`, `data-source`, `plural-data-source`.
137133
# details on usage can be found in contributing/development-best-practices.md under "Scaffolding initial Code and File Structure"
138134
.PHONY: scaffold
139-
scaffold:
135+
scaffold: ## Create scaffolding for a new resource
140136
@go run ./tools/scaffold/*.go $(resource_name) $(type)
141137
@echo "Reminder: configure the new $(type) in provider.go"
142138

143139
# e.g. run: make scaffold-schemas resource_name=streamInstance
144140
# details on usage can be found in contributing/development-best-practices.md under "Generating Schema and Model Definitions - Using schema generation HashiCorp tooling"
145141
.PHONY: scaffold-schemas
146-
scaffold-schemas:
142+
scaffold-schemas: ## Create the schema scaffolding for a new resource
147143
@scripts/schema-scaffold.sh $(resource_name)
148144

149145
# e.g. run: make generate-schema resource_name=search_deployment
150146
# resource_name is optional, if not provided all configured resources will be generated
151147
# details on usage can be found in contributing/development-best-practices.md under "Generating Schema and Model Definitions - Using internal tool"
152148
.PHONY: generate-schema
153-
generate-schema:
149+
generate-schema: ## Generate the schema for a resource
154150
@go run ./tools/codegen/main.go $(resource_name)
155151

156152
.PHONY: generate-doc
157153
# e.g. run: make generate-doc resource_name=search_deployment
158154
# generate the resource documentation via tfplugindocs
159-
generate-doc:
155+
generate-doc: ## Auto-generate the documentation for a resource
160156
@scripts/generate-doc.sh ${resource_name}
161157

162158
# generate the resource documentation via tfplugindocs for all resources that have templates
163159
.PHONY: generate-docs-all
164-
generate-docs-all:
160+
generate-docs-all: ## Auto-generate the documentation for all resources
165161
@scripts/generate-docs-all.sh
166162

167163
.PHONY: update-tf-compatibility-matrix
@@ -173,23 +169,23 @@ update-tf-version-in-repository: ## Update Terraform versions
173169
./scripts/update-tf-version-in-repository.sh
174170

175171
.PHONY: update-changelog-unreleased-section
176-
update-changelog-unreleased-section:
172+
update-changelog-unreleased-section: ## Update changelog unreleased section
177173
./scripts/update-changelog-unreleased-section.sh
178174

179175
.PHONY: generate-changelog-entry
180-
generate-changelog-entry:
176+
generate-changelog-entry: ## Generate a changelog entry in a PR
181177
./scripts/generate-changelog-entry.sh
182178

183179
.PHONY: check-changelog-entry-file
184-
check-changelog-entry-file:
180+
check-changelog-entry-file: ## Check a changelog entry file in a PR
185181
go run ./tools/check-changelog-entry-file/*.go
186182

187183
.PHONY: jira-release-version
188-
jira-release-version:
184+
jira-release-version: ## Update Jira version in a release
189185
go run ./tools/jira-release-version/*.go
190186

191187
.PHONY: enable-advancedclustertpf
192-
enable-advancedclustertpf:
188+
enable-advancedclustertpf: ## Enable Advanced Cluster V2 Schema
193189
make change-lines filename=./internal/config/advanced_cluster_v2_schema.go find="allowAdvancedClusterV2Schema = false" new="allowAdvancedClusterV2Schema = true"
194190

195191
.PHONY: delete-lines ${filename} ${delete}

0 commit comments

Comments
 (0)