From c00dc3919b6f34d6fbf1fdd02d05e27692ccf42a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 8 Oct 2025 02:58:10 -0500 Subject: add make generate --- Makefile | 10 ++++++++-- README.md | 22 ++-------------------- generate.go | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 generate.go diff --git a/Makefile b/Makefile index 4d586a2..a0f2efc 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,12 @@ -all: proto goimports vet +all: goimports vet -redo: clean proto goimports vet +generate: clean + go mod init + go mod tidy + go generate + +go-generate: + rm -f *.pb.go vet: @GO111MODULE=off go vet diff --git a/README.md b/README.md index bd80967..d649f23 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,3 @@ -This package should be a GO Primitive package and -therefore have a minimum go.sum file. +# protobuf definition file for git-bug -TODO: Appeal to have google.golang.org/protobuf moved into GO itself - -# protobuf definition files for git-bug - -This is to make a easy way to parse the bugs from -the federated git-bug system. Search can be implemented -on top of this protobuf definition instead of being mixed -in with the database code. - -##### - -The above was the original intent of this package and -probably will still be that way, but, this is a good -name for "bugs" in protobufs themselves and I've -moved things like the Validate UTF-8 things here. - -In general, maybe it'll be more of a toolbox of common -useful protobuf routines +an experiement with git-bug diff --git a/generate.go b/generate.go new file mode 100644 index 0000000..2250a45 --- /dev/null +++ b/generate.go @@ -0,0 +1,14 @@ +package bugpb + +// NOTE: it would be helpful if go.mod doesn't exist, that go generate +// would automatically run go mod init and go mod tidy +// and allow directives to 'go get go.wit.com/apps/autogenpb' +// then this process could be fully automated +// +//go:generate make go-generate +//go:generate go get go.wit.com/apps/autogenpb +//go:generate go install -v go.wit.com/apps/autogenpb +//go:generate autogenpb --proto bug.proto +// # go:generate go get golang.org/x/tools # repo seems broken at this time (?) +// # go:generate go install -v golang.org/x/tools/cmd/goimports +//go:generate bash -c "goimports -w *.go" -- cgit v1.2.3