Skip to content

Commit 3259489

Browse files
authored
Merge pull request #909 from axone-protocol/chore/normalize-Makefile-whitespaces
Chore/normalize makefile whitespaces
2 parents 0b7a005 + b470694 commit 3259489

File tree

2 files changed

+108
-104
lines changed

2 files changed

+108
-104
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ indent_style = tab
3131

3232
[*.feature]
3333
indent_size = 2
34+
35+
[Makefile]
36+
indent_style = tab
37+
tab_width = 2

Makefile

Lines changed: 104 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CMD_ROOT := ./cmd/${BINARY_NAME}
1010
LEDGER_ENABLED ?= true
1111

1212
# Docker images
13-
DOCKER_IMAGE_GOLANG = golang:1.23-alpine3.20
13+
DOCKER_IMAGE_GOLANG = golang:1.23-alpine3.20
1414
DOCKER_IMAGE_GOLANG_CI = golangci/golangci-lint:v1.61
1515
DOCKER_IMAGE_PROTO = ghcr.io/cosmos/proto-builder:0.14.0
1616
DOCKER_IMAGE_BUF = bufbuild/buf:1.4.0
@@ -44,13 +44,13 @@ COLOR_RED = $(call get_color,setaf,1)
4444
COLOR_RESET = $(call get_color,sgr0,)
4545

4646
# Blockchain constants
47-
CHAIN := localnet
48-
CHAIN_HOME := ./target/deployment/${CHAIN}
49-
CHAIN_MONIKER := local-node
50-
CHAIN_BINARY := ./${DIST_FOLDER}/${BINARY_NAME}
47+
CHAIN := localnet
48+
CHAIN_HOME := ./target/deployment/${CHAIN}
49+
CHAIN_MONIKER := local-node
50+
CHAIN_BINARY := ./${DIST_FOLDER}/${BINARY_NAME}
5151

52-
DAEMON_NAME := axoned
53-
DAEMON_HOME := `pwd`/${CHAIN_HOME}
52+
DAEMON_NAME := axoned
53+
DAEMON_HOME := `pwd`/${CHAIN_HOME}
5454

5555
# Binary information
5656
VERSION := $(shell cat version)
@@ -67,26 +67,26 @@ MAX_WASM_SIZE := $(shell echo "$$((1 * 1024 * 1024))")
6767
build_tags += netgo
6868
build_tags := $(strip $(build_tags))
6969
ifeq ($(LEDGER_ENABLED),true)
70-
ifeq ($(OS),Windows_NT)
71-
GCCEXE = $(shell where gcc.exe 2> NUL)
72-
ifeq ($(GCCEXE),)
73-
$(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false)
74-
else
75-
build_tags += ledger
76-
endif
77-
else
78-
UNAME_S = $(shell uname -s)
79-
ifeq ($(UNAME_S),OpenBSD)
80-
$(warning OpenBSD detected, disabling ledger support (https://$(MODULE_COSMOS_SDK)/issues/1988))
81-
else
82-
GCC = $(shell command -v gcc 2> /dev/null)
83-
ifeq ($(GCC),)
84-
$(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false)
85-
else
86-
build_tags += ledger
87-
endif
88-
endif
89-
endif
70+
ifeq ($(OS),Windows_NT)
71+
GCCEXE = $(shell where gcc.exe 2> NUL)
72+
ifeq ($(GCCEXE),)
73+
$(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false)
74+
else
75+
build_tags += ledger
76+
endif
77+
else
78+
UNAME_S = $(shell uname -s)
79+
ifeq ($(UNAME_S),OpenBSD)
80+
$(warning OpenBSD detected, disabling ledger support (https://$(MODULE_COSMOS_SDK)/issues/1988))
81+
else
82+
GCC = $(shell command -v gcc 2> /dev/null)
83+
ifeq ($(GCC),)
84+
$(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false)
85+
else
86+
build_tags += ledger
87+
endif
88+
endif
89+
endif
9090
endif
9191

9292
build_tags += $(BUILD_TAGS)
@@ -96,15 +96,15 @@ comma := ,
9696
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))
9797

9898
# Flags
99-
ldflags = \
100-
-X $(MODULE_COSMOS_SDK)/version.AppName=axoned \
101-
-X $(MODULE_COSMOS_SDK)/version.Name=axoned \
102-
-X $(MODULE_COSMOS_SDK)/version.ServerName=axoned \
103-
-X $(MODULE_COSMOS_SDK)/version.ClientName=axoned \
104-
-X $(MODULE_COSMOS_SDK)/version.Version=$(VERSION) \
105-
-X $(MODULE_COSMOS_SDK)/version.Commit=$(COMMIT) \
106-
-X $(MODULE_COSMOS_SDK)/version.BuildTags=$(build_tags_comma_sep) \
107-
-X $(MODULE_AXONED)/app.MaxWasmSize=$(MAX_WASM_SIZE) \
99+
ldflags = \
100+
-X $(MODULE_COSMOS_SDK)/version.AppName=axoned \
101+
-X $(MODULE_COSMOS_SDK)/version.Name=axoned \
102+
-X $(MODULE_COSMOS_SDK)/version.ServerName=axoned \
103+
-X $(MODULE_COSMOS_SDK)/version.ClientName=axoned \
104+
-X $(MODULE_COSMOS_SDK)/version.Version=$(VERSION) \
105+
-X $(MODULE_COSMOS_SDK)/version.Commit=$(COMMIT) \
106+
-X $(MODULE_COSMOS_SDK)/version.BuildTags=$(build_tags_comma_sep) \
107+
-X $(MODULE_AXONED)/app.MaxWasmSize=$(MAX_WASM_SIZE) \
108108

109109
ifeq (,$(findstring nostrip,$(BUILD_OPTIONS)))
110110
ldflags += -w -s
@@ -124,7 +124,7 @@ GO_BUILD := go build $(BUILD_FLAGS)
124124
ENVIRONMENTS = \
125125
darwin-amd64 \
126126
darwin-arm64 \
127-
linux-amd64 \
127+
linux-amd64 \
128128
linux-arm64
129129
ENVIRONMENTS_TARGETS = $(addprefix build-go-, $(ENVIRONMENTS))
130130

@@ -151,10 +151,10 @@ lint: lint-go lint-proto ## Lint all available linters
151151
lint-go: ## Lint go source code
152152
@echo "${COLOR_CYAN}🔍 Inspecting go source code${COLOR_RESET}"
153153
@docker run --rm \
154-
-v `pwd`:/app:ro \
155-
-w /app \
156-
${DOCKER_IMAGE_GOLANG_CI} \
157-
golangci-lint run -v
154+
-v `pwd`:/app:ro \
155+
-w /app \
156+
${DOCKER_IMAGE_GOLANG_CI} \
157+
golangci-lint run -v
158158

159159
.PHONY: lint-proto
160160
lint-proto: ## Lint proto files
@@ -169,10 +169,10 @@ format: format-go ## Run all available formatters
169169
format-go: ## Format go files
170170
@echo "${COLOR_CYAN}📐 Formatting go source code${COLOR_RESET}"
171171
@docker run --rm \
172-
-v `pwd`:/app:rw \
173-
-w /app \
174-
${DOCKER_IMAGE_GOLANG} \
175-
sh -c \
172+
-v `pwd`:/app:rw \
173+
-w /app \
174+
${DOCKER_IMAGE_GOLANG} \
175+
sh -c \
176176
"go install mvdan.cc/gofumpt@v0.7.0; gofumpt -w -l ."
177177

178178
.PHONY: format-proto
@@ -200,18 +200,18 @@ $(ENVIRONMENTS_TARGETS):
200200
@GOOS=$(word 3, $(subst -, ,$@)); \
201201
GOARCH=$(word 4, $(subst -, ,$@)); \
202202
if [ $$GOARCH = "amd64" ]; then \
203-
TARGET_ARCH="x86_64"; \
204-
elif [ $$GOARCH = "arm64" ]; then \
205-
TARGET_ARCH="aarch64"; \
206-
fi; \
207-
HOST_OS=`uname -s | tr A-Z a-z`; \
208-
HOST_ARCH=`uname -m`; \
209-
if [ $$GOOS != $$HOST_OS ] || [ $$TARGET_ARCH != $$HOST_ARCH ]; then \
210-
echo "${COLOR_RED} ❌ Cross compilation impossible${COLOR_RESET}" >&2; \
211-
exit 1; \
212-
fi; \
213-
FOLDER=${DIST_FOLDER}/$$GOOS/$$GOARCH; \
214-
FILENAME=$$FOLDER/${BINARY_NAME}; \
203+
TARGET_ARCH="x86_64"; \
204+
elif [ $$GOARCH = "arm64" ]; then \
205+
TARGET_ARCH="aarch64"; \
206+
fi; \
207+
HOST_OS=`uname -s | tr A-Z a-z`; \
208+
HOST_ARCH=`uname -m`; \
209+
if [ $$GOOS != $$HOST_OS ] || [ $$TARGET_ARCH != $$HOST_ARCH ]; then \
210+
echo "${COLOR_RED} ❌ Cross compilation impossible${COLOR_RESET}" >&2; \
211+
exit 1; \
212+
fi; \
213+
FOLDER=${DIST_FOLDER}/$$GOOS/$$GOARCH; \
214+
FILENAME=$$FOLDER/${BINARY_NAME}; \
215215
echo "${COLOR_CYAN} 🏗️ Building project ${COLOR_RESET}${CMD_ROOT}${COLOR_CYAN} for environment ${COLOR_YELLOW}$$GOOS ($$GOARCH)${COLOR_RESET} into ${COLOR_YELLOW}$$FOLDER${COLOR_RESET}" && \
216216
$(call build-go,$$GOOS,$$GOARCH,$$FILENAME)
217217

@@ -237,37 +237,37 @@ chain-init: build-go ## Initialize the blockchain with default settings.
237237

238238
@rm -rf "${CHAIN_HOME}"; \
239239
${CHAIN_BINARY} init axone-node \
240-
--chain-id=axone-${CHAIN} \
241-
--home "${CHAIN_HOME}"; \
240+
--chain-id=axone-${CHAIN} \
241+
--home "${CHAIN_HOME}"; \
242242
\
243243
sed -i $(SED_FLAG) "s/\"stake\"/\"uaxone\"/g" "${CHAIN_HOME}/config/genesis.json"; \
244244
\
245245
MNEMONIC_VALIDATOR="island position immense mom cross enemy grab little deputy tray hungry detect state helmet \
246-
tomorrow trap expect admit inhale present vault reveal scene atom"; \
246+
tomorrow trap expect admit inhale present vault reveal scene atom"; \
247247
echo $$MNEMONIC_VALIDATOR \
248-
| ${CHAIN_BINARY} keys add validator \
249-
--recover \
250-
--keyring-backend test \
251-
--home "${CHAIN_HOME}"; \
248+
| ${CHAIN_BINARY} keys add validator \
249+
--recover \
250+
--keyring-backend test \
251+
--home "${CHAIN_HOME}"; \
252252
\
253253
${CHAIN_BINARY} genesis add-genesis-account validator 1000000000uaxone \
254-
--keyring-backend test \
255-
--home "${CHAIN_HOME}"; \
254+
--keyring-backend test \
255+
--home "${CHAIN_HOME}"; \
256256
\
257257
NODE_ID=`${CHAIN_BINARY} tendermint show-node-id --home ${CHAIN_HOME}`; \
258258
${CHAIN_BINARY} genesis gentx validator 1000000uaxone \
259-
--node-id $$NODE_ID \
260-
--chain-id=axone-${CHAIN} \
261-
--keyring-backend test \
262-
--home "${CHAIN_HOME}"; \
259+
--node-id $$NODE_ID \
260+
--chain-id=axone-${CHAIN} \
261+
--keyring-backend test \
262+
--home "${CHAIN_HOME}"; \
263263
\
264264
${CHAIN_BINARY} genesis collect-gentxs \
265-
--home "${CHAIN_HOME}"
265+
--home "${CHAIN_HOME}"
266266

267267
chain-start: build-go ## Start the blockchain with existing configuration (see chain-init)
268268
@echo "${COLOR_CYAN} 🛠️ Starting chain ${COLOR_RESET}${CHAIN}${COLOR_CYAN} with configuration ${COLOR_YELLOW}${CHAIN_HOME}${COLOR_RESET}"; \
269269
${CHAIN_BINARY} start --moniker ${CHAIN_MONIKER} \
270-
--home ${CHAIN_HOME}
270+
--home ${CHAIN_HOME}
271271

272272
chain-stop: ## Stop the blockchain
273273
@echo "${COLOR_CYAN} ✋️ Stopping chain ${COLOR_RESET}${CHAIN}${COLOR_CYAN} with configuration ${COLOR_YELLOW}${CHAIN_HOME}${COLOR_RESET}"
@@ -290,35 +290,35 @@ chain-upgrade: build-go ## Test the chain upgrade from the given FROM_VERSION to
290290
export DAEMON_NAME=${DAEMON_NAME}; \
291291
export DAEMON_HOME=${DAEMON_HOME}; \
292292
\
293-
cat <<< $$(jq '.app_state.gov.params.voting_period = "20s"' ${CHAIN_HOME}/config/genesis.json) > ${CHAIN_HOME}/config/genesis.json; \
293+
cat <<< $$(jq '.app_state.gov.params.voting_period = "20s"' ${CHAIN_HOME}/config/genesis.json) > ${CHAIN_HOME}/config/genesis.json; \
294294
\
295-
cosmovisor init $$BINARY_OLD; \
296-
cosmovisor run start --moniker ${CHAIN_MONIKER} \
297-
--home ${CHAIN_HOME} \
298-
--log_level debug & \
295+
cosmovisor init $$BINARY_OLD; \
296+
cosmovisor run start --moniker ${CHAIN_MONIKER} \
297+
--home ${CHAIN_HOME} \
298+
--log_level debug & \
299299
sleep 10; \
300300
echo "${COLOR_CYAN} 🗳️ Submitting software-upgrade tx ${COLOR_RESET}"; \
301301
$$BINARY_OLD tx upgrade software-upgrade ${TO_VERSION}\
302-
--title "Axoned upgrade" \
303-
--summary "⬆️ Upgrade the chain from ${FROM_VERSION} to ${TO_VERSION}" \
304-
--upgrade-height 20 \
305-
--upgrade-info "{}" \
306-
--deposit 10000000uaxone \
307-
--no-validate \
308-
--yes \
309-
--from validator \
310-
--keyring-backend test \
311-
--chain-id axone-${CHAIN} \
312-
--home ${CHAIN_HOME}; \
302+
--title "Axoned upgrade" \
303+
--summary "⬆️ Upgrade the chain from ${FROM_VERSION} to ${TO_VERSION}" \
304+
--upgrade-height 20 \
305+
--upgrade-info "{}" \
306+
--deposit 10000000uaxone \
307+
--no-validate \
308+
--yes \
309+
--from validator \
310+
--keyring-backend test \
311+
--chain-id axone-${CHAIN} \
312+
--home ${CHAIN_HOME}; \
313313
sleep 5;\
314314
\
315315
sleep 5;\
316-
$$BINARY_OLD tx gov vote 1 yes \
317-
--from validator \
318-
--yes \
319-
--home ${CHAIN_HOME} \
320-
--chain-id axone-${CHAIN} \
321-
--keyring-backend test; \
316+
$$BINARY_OLD tx gov vote 1 yes \
317+
--from validator \
318+
--yes \
319+
--home ${CHAIN_HOME} \
320+
--chain-id axone-${CHAIN} \
321+
--keyring-backend test; \
322322
mkdir -p ${DAEMON_HOME}/cosmovisor/upgrades/${TO_VERSION}/bin && cp ${CHAIN_BINARY} ${DAEMON_HOME}/cosmovisor/upgrades/${TO_VERSION}/bin; \
323323
wait
324324

@@ -348,9 +348,9 @@ doc-proto: proto-gen ## Generate the documentation from the Protobuf files
348348
@$(DOCKER_PROTO_RUN) sh ./scripts/protocgen-doc.sh
349349
@for MODULE in $(shell find proto -name '*.proto' -maxdepth 3 -print0 | xargs -0 -n1 dirname | sort | uniq | xargs dirname) ; do \
350350
echo "${COLOR_CYAN} 📖 Generate documentation for $${MODULE} module${COLOR_RESET}" ; \
351-
DEFAULT_DATASOURCE="./docs/proto/templates/default.yaml" ; \
352-
MODULE_DATASOURCE="merge:./$${MODULE}/docs.yaml|$${DEFAULT_DATASOURCE}" ; \
353-
DATASOURCE="docs=`[ -f $${MODULE}/docs.yaml ] && echo $$MODULE_DATASOURCE || echo $${DEFAULT_DATASOURCE}`" ; \
351+
DEFAULT_DATASOURCE="./docs/proto/templates/default.yaml" ; \
352+
MODULE_DATASOURCE="merge:./$${MODULE}/docs.yaml|$${DEFAULT_DATASOURCE}" ; \
353+
DATASOURCE="docs=`[ -f $${MODULE}/docs.yaml ] && echo $$MODULE_DATASOURCE || echo $${DEFAULT_DATASOURCE}`" ; \
354354
docker run --rm \
355355
-v ${HOME}/.cache:/root/.cache \
356356
-v `pwd`:/usr/src/axoned \
@@ -390,9 +390,9 @@ doc-predicate: ## Generate markdown documentation for all the predicates (module
390390
go get ./scripts; \
391391
go run ./scripts/. predicate; \
392392
docker run --rm \
393-
-v `pwd`:/usr/src/docs \
394-
-w /usr/src/docs \
395-
${DOCKER_IMAGE_MARKDOWNLINT} -f $$OUT_FOLDER -c docs/.markdownlint.yaml
393+
-v `pwd`:/usr/src/docs \
394+
-w /usr/src/docs \
395+
${DOCKER_IMAGE_MARKDOWNLINT} -f $$OUT_FOLDER -c docs/.markdownlint.yaml
396396

397397

398398
## Mock:
@@ -407,8 +407,8 @@ mock: ## Generate all the mocks (for tests)
407407
@mockgen -destination x/logic/testutil/fs_mocks.go -package testutil io/fs FS
408408
@mockgen -destination x/logic/testutil/read_file_fs_mocks.go -package testutil io/fs ReadFileFS
409409
@mockgen -source "$$(go list -f '{{.Dir}}' $(MODULE_COSMOS_SDK)/codec/types)/interface_registry.go" \
410-
-package testutil \
411-
-destination x/logic/testutil/interface_registry_mocks.go
410+
-package testutil \
411+
-destination x/logic/testutil/interface_registry_mocks.go
412412

413413
## Release:
414414
.PHONY: release-assets
@@ -418,8 +418,8 @@ release-binary-all: $(RELEASE_TARGETS)
418418

419419
$(RELEASE_TARGETS): ensure-buildx-builder
420420
@GOOS=$(word 3, $(subst -, ,$@)); \
421-
GOARCH=$(word 4, $(subst -, ,$@)); \
422-
BINARY_NAME="axoned-${VERSION}-$$GOOS-$$GOARCH"; \
421+
GOARCH=$(word 4, $(subst -, ,$@)); \
422+
BINARY_NAME="axoned-${VERSION}-$$GOOS-$$GOARCH"; \
423423
echo "${COLOR_CYAN} 🎁 Building ${COLOR_GREEN}$$GOOS $$GOARCH ${COLOR_CYAN}release binary${COLOR_RESET} into ${COLOR_YELLOW}${RELEASE_FOLDER}${COLOR_RESET}"; \
424424
docker buildx use ${DOCKER_BUILDX_BUILDER}; \
425425
docker buildx build \

0 commit comments

Comments
 (0)