From 7da17a201315104942e023f4573e145eff0b038a Mon Sep 17 00:00:00 2001 From: lumtis Date: Sun, 19 May 2024 18:42:35 +0200 Subject: [PATCH] add golines to make generate --- Makefile | 6 +++++- scripts/fmt-golines.sh | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 scripts/fmt-golines.sh diff --git a/Makefile b/Makefile index d5446322db..afa92e3a79 100644 --- a/Makefile +++ b/Makefile @@ -185,7 +185,11 @@ mocks: @bash ./scripts/mocks-generate.sh .PHONY: mocks -generate: proto-gen openapi specs typescript docs-zetacored mocks +fmt-golines: + @echo "--> Formatting Go lines" + @bash ./scripts/fmt-golines.sh + +generate: proto-gen openapi specs typescript docs-zetacored mocks fmt-golines .PHONY: generate ############################################################################### diff --git a/scripts/fmt-golines.sh b/scripts/fmt-golines.sh new file mode 100644 index 0000000000..034e3591de --- /dev/null +++ b/scripts/fmt-golines.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Install golines +go install github.com/segmentio/golines@v0.9.0 + +# Run golines in Cosmos modules and ZetaClient codebase +find ./x ./zetaclient -type f -name '*.go' -exec golines -w --max-len=120 {} + > /dev/null 2>&1 + +# Print a message to indicate completion +echo "Go source code lines formatted." \ No newline at end of file