From 764a457eb053e4209f1754ee112c978135539546 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Sun, 23 Jul 2023 10:36:01 +0300 Subject: [PATCH 1/2] De-generate build process Just call the flag builder directly --- cli.go | 2 -- internal/build/build.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cli.go b/cli.go index 28ad0582b6..fbec4e3694 100644 --- a/cli.go +++ b/cli.go @@ -21,5 +21,3 @@ // app.Run(os.Args) // } package cli - -//go:generate make -C cmd/urfave-cli-genflags run diff --git a/internal/build/build.go b/internal/build/build.go index 4ffd2c4741..cfa905e371 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -519,7 +519,7 @@ func GenerateActionFunc(cCtx *cli.Context) error { } log.Println("--- generating Go source files ---") - return runCmd("go", "generate", cCtx.Path("top")+"/...") + return runCmd("make", "-C", cCtx.Path("top")+"/cmd/urfave-cli-genflags", "run") } func YAMLFmtActionFunc(cCtx *cli.Context) error { From 89d7e6341671198f1aec6177ed50ff29f4074806 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Sun, 23 Jul 2023 10:49:53 +0300 Subject: [PATCH 2/2] Remove "go generate" from the docs --- docs/CONTRIBUTING.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index d657477f5f..1a9e153964 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -84,14 +84,13 @@ step. #### generated code -A significant portion of the project's source code is generated, with the goal being to +A significant portion of the project's source code is generated, to eliminate repetitive maintenance where other type-safe abstraction is impractical or impossible with Go versions `< 1.18`. In a future where the eldest Go version supported is `1.18.x`, there will likely be efforts to take advantage of [generics](https://go.dev/doc/tutorial/generics). -The built-in `go generate` command is used to run the commands specified in -`//go:generate` directives. Each such command runs a file that also supports a command +Generator scripts also support command line help system which may be consulted for further information, e.g.: ```sh