Skip to content

Commit 3a8eff2

Browse files
authored
chore: improve Make help command (#3640)
1 parent 8c405e1 commit 3a8eff2

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

Makefile

+21-18
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ build:
3939
@go build -o build/ ${LDFLAGS} ./cmd/celestia
4040
.PHONY: build
4141

42-
## build-jemalloc: Build celestia-node binary with jemalloc allocator for BadgerDB instead of Go's native one
42+
## build-jemalloc: Build celestia-node binary with jemalloc allocator for BadgerDB.
4343
build-jemalloc: jemalloc
4444
@echo "--> Building Celestia with jemalloc"
4545
@go build -o build/ ${LDFLAGS} -tags jemalloc ./cmd/celestia
@@ -51,14 +51,14 @@ clean:
5151
@rm -rf build/*
5252
.PHONY: clean
5353

54-
## cover: generate to code coverage report.
54+
## cover: Generate code coverage report.
5555
cover:
5656
@echo "--> Generating Code Coverage"
5757
@go install github.com/ory/go-acc@latest
5858
@go-acc -o coverage.txt `go list ./... | grep -v nodebuilder/tests` -- -v
5959
.PHONY: cover
6060

61-
## deps: install dependencies.
61+
## deps: Install dependencies.
6262
deps:
6363
@echo "--> Installing Dependencies"
6464
@go mod download
@@ -73,7 +73,7 @@ else
7373
endif
7474
.PHONY: install
7575

76-
## install-global: Install the celestia-node binary (only for systems that support GNU coreutils, i.e. Linux).
76+
## install-global: Install the celestia-node binary (only for systems that support GNU coreutils like Linux).
7777
install-global:
7878
@echo "--> Installing Celestia"
7979
@install -v ./build/* -t ${PREFIX}/bin
@@ -109,7 +109,8 @@ install-key:
109109
@go install ./cmd/cel-key
110110
.PHONY: install-key
111111

112-
## fmt: Formats only *.go (excluding *.pb.go *pb_test.go). Runs `gofmt & goimports` internally.
112+
## fmt: Formats only *.go (excluding *.pb.go *pb_test.go).
113+
# Runs `gofmt & goimports` internally.
113114
fmt: sort-imports
114115
@find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs gofmt -w -s
115116
@go mod tidy -compat=1.20
@@ -118,39 +119,40 @@ fmt: sort-imports
118119
@markdownlint --fix --quiet --config .markdownlint.yaml .
119120
.PHONY: fmt
120121

121-
## lint: Linting *.go files using golangci-lint. Look for .golangci.yml for the list of linters. Also lint *.md files using markdownlint.
122+
## lint: Lint *.go files with golangci-lint and *.md files with markdownlint.
123+
# Look at .golangci.yml for the list of linters.
122124
lint: lint-imports
123125
@echo "--> Running linter"
124126
@golangci-lint run
125127
@markdownlint --config .markdownlint.yaml '**/*.md'
126128
@cfmt --m=120 ./...
127129
.PHONY: lint
128130

129-
## test-unit: Running unit tests
131+
## test-unit: Run unit tests.
130132
test-unit:
131133
@echo "--> Running unit tests"
132134
@go test $(VERBOSE) -covermode=atomic -coverprofile=coverage.txt `go list ./... | grep -v nodebuilder/tests` $(LOG_AND_FILTER)
133135
.PHONY: test-unit
134136

135-
## test-unit-race: Running unit tests with data race detector
137+
## test-unit-race: Run unit tests with data race detector.
136138
test-unit-race:
137139
@echo "--> Running unit tests with data race detector"
138140
@go test $(VERBOSE) -race -covermode=atomic -coverprofile=coverage.txt `go list ./... | grep -v nodebuilder/tests` $(LOG_AND_FILTER)
139141
.PHONY: test-unit-race
140142

141-
## test-integration: Running /integration tests located in nodebuilder/tests
143+
## test-integration: Run integration tests located in nodebuilder/tests.
142144
test-integration:
143145
@echo "--> Running integrations tests $(VERBOSE) -tags=$(TAGS) $(INTEGRATION_RUN_LENGTH)"
144146
@go test $(VERBOSE) -tags=$(TAGS) $(INTEGRATION_RUN_LENGTH) ./nodebuilder/tests
145147
.PHONY: test-integration
146148

147-
## test-integration-race: Running integration tests with data race detector located in node/tests
149+
## test-integration-race: Run integration tests with data race detector located in nodebuilder/tests.
148150
test-integration-race:
149151
@echo "--> Running integration tests with data race detector -tags=$(TAGS)"
150152
@go test -race -tags=$(TAGS) ./nodebuilder/tests
151153
.PHONY: test-integration-race
152154

153-
## benchmark: Running all benchmarks
155+
## benchmark: Run all benchmarks.
154156
benchmark:
155157
@echo "--> Running benchmarks"
156158
@go test -run="none" -bench=. -benchtime=100x -benchmem ./...
@@ -173,14 +175,14 @@ pb-gen:
173175
done;
174176
.PHONY: pb-gen
175177

176-
## openrpc-gen: Generate OpenRPC spec for Celestia-Node's RPC api
178+
## openrpc-gen: Generate OpenRPC spec for celestia-node's RPC API.
177179
openrpc-gen:
178180
@go run ${LDFLAGS} ./cmd/celestia docgen
179181
.PHONY: openrpc-gen
180182

181183
## lint-imports: Lint only Go imports.
182-
## flag -set-exit-status doesn't exit with code 1 as it should, so we use find until it is fixed by goimports-reviser
183184
lint-imports:
185+
# flag -set-exit-status doesn't exit with code 1 as it should, so we use find until it is fixed by goimports-reviser
184186
@echo "--> Running imports linter"
185187
@for file in `find . -type f -name '*.go'`; \
186188
do goimports-reviser -list-diff -set-exit-status -company-prefixes "github.com/celestiaorg" -project-name "github.com/celestiaorg/celestia-node" -output stdout $$file \
@@ -199,13 +201,13 @@ adr-gen:
199201
@curl -sSL https://raw.githubusercontent.com/celestiaorg/.github/main/adr-template.md > docs/architecture/adr-$(NUM)-$(TITLE).md
200202
.PHONY: adr-gen
201203

202-
## telemetry-infra-up: launches local telemetry infrastructure. This includes grafana, jaeger, loki, pyroscope, and an otel-collector.
203-
## you can access the grafana instance at localhost:3000 and login with admin:admin.
204+
## telemetry-infra-up: Launch local telemetry infra (grafana, jaeger, loki, pyroscope, and otel-collector).
205+
# You can access the grafana instance at localhost:3000 and login with admin:admin.
204206
telemetry-infra-up:
205207
PWD="${DIR_FULLPATH}/docker/telemetry" docker-compose -f ./docker/telemetry/docker-compose.yml up
206208
.PHONY: telemetry-infra-up
207209

208-
## telemetry-infra-down: tears the telemetry infrastructure down. The stores for grafana, prometheus, and loki will persist.
210+
## telemetry-infra-down: Tears the telemetry infra down. Persists the stores for grafana, prometheus, and loki.
209211
telemetry-infra-down:
210212
PWD="${DIR_FULLPATH}/docker/telemetry" docker-compose -f ./docker/telemetry/docker-compose.yml down
211213
.PHONY: telemetry-infra-down
@@ -222,7 +224,8 @@ goreleaser-build:
222224
goreleaser build --snapshot --clean --single-target
223225
.PHONY: goreleaser-build
224226

225-
## goreleaser-release: Builds the release celestia binaries as defined in .goreleaser.yaml. This requires there be a git tag for the release in the local git history.
227+
## goreleaser-release: Builds the release celestia binaries as defined in .goreleaser.yaml.
228+
# This requires there be a git tag for the release in the local git history.
226229
goreleaser-release:
227230
goreleaser release --clean --fail-fast --skip-publish
228231
.PHONY: goreleaser-release
@@ -232,7 +235,7 @@ USER_ID = $(shell id -u)
232235
HAS_JEMALLOC = $(shell test -f /usr/local/lib/libjemalloc.a && echo "jemalloc")
233236
JEMALLOC_URL = "https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2"
234237

235-
## jemalloc installs jemalloc allocator
238+
## jemalloc: Install jemalloc allocator.
236239
jemalloc:
237240
@if [ -z "$(HAS_JEMALLOC)" ] ; then \
238241
mkdir -p /tmp/jemalloc-temp && cd /tmp/jemalloc-temp ; \

0 commit comments

Comments
 (0)