Skip to content

Commit 6c90405

Browse files
committed
refactor: run gofumpt only without goimports
Signed-off-by: Christian Stewart <christian@aperture.us>
1 parent 63ee341 commit 6c90405

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

Makefile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ $(eval $(call build_tool,$(WASMBROWSERTEST),github.com/agnivade/wasmbrowsertest)
6969
# $(eval $(call build_tool,$(GOSCRIPT),github.com/aperturerobotics/goscript/cmd/goscript))
7070

7171
.PHONY: protodeps
72-
protodeps: $(GOIMPORTS) $(PROTOWRAP) $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_STARPC) $(PROJECT_DIR)/node_modules
72+
protodeps: $(GOFUMPT) $(PROTOWRAP) $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_STARPC) $(PROJECT_DIR)/node_modules
7373

7474
# Default protogen targets and arguments
7575
PROTOGEN_TARGETS ?= ./*.proto
@@ -146,7 +146,7 @@ genproto: protodeps
146146
done; \
147147
done; \
148148
if [ -n "$${FMT_GO_FILES}" ]; then \
149-
$(GOIMPORTS) -w $${FMT_GO_FILES[@]}; \
149+
$(GOFUMPT) -w $${FMT_GO_FILES[@]}; \
150150
fi; \
151151
if [ -n "$${FMT_TS_FILES}" ]; then \
152152
prettier --config $(TOOLS_DIR)/.prettierrc.yaml -w $${FMT_TS_FILES[@]}; \
@@ -192,11 +192,18 @@ test-browser: $(WASMBROWSERTEST)
192192
-v ./...
193193

194194
.PHONY: format
195-
format: $(GOFUMPT) $(GOIMPORTS)
195+
format: gofumpt
196+
197+
.PHONY: gofumpt
198+
gofumpt: $(GOFUMPT)
196199
cd $(PROJECT_DIR); \
197-
$(GOIMPORTS) -w ./; \
198200
$(GOFUMPT) -w ./
199201

202+
.PHONY: goimports
203+
goimports: $(GOIMPORTS)
204+
cd $(PROJECT_DIR); \
205+
$(GOIMPORTS) -w ./
206+
200207
.PHONY: release
201208
release: $(GORELEASER)
202209
cd $(PROJECT_DIR); \

example/example.pb.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/other/other.pb.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)