From ae943f0246116953e6123c8d007dd6cc43bbb976 Mon Sep 17 00:00:00 2001 From: Matthias Friedrich <1573457+matzefriedrich@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:56:17 +0100 Subject: [PATCH] Feature/update cobra extensions v0.4.0 (#40) * Update dependencies * Adds detailed descriptions to command flags * Updates long descriptions in command struct tags --- CHANGELOG.md | 9 +++++++++ go.mod | 4 +++- go.sum | 6 ++++-- internal/commands/generate_mocks_command.go | 2 +- internal/commands/generate_proxy_command.go | 2 +- internal/commands/generator_command.go | 4 ++-- internal/commands/init_command.go | 2 +- 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dce461..6616c1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v1.0.5] - 2024-11-27 + +### Changed + +* Updates package dependencies + + ## [v1.0.4] - 2024-11-18 +### Changed + * Updated package dependencies (as reported by Dependabot). diff --git a/go.mod b/go.mod index 5f79563..a7df903 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/matzefriedrich/parsley go 1.23 require ( - github.com/matzefriedrich/cobra-extensions v0.3.2 + github.com/matzefriedrich/cobra-extensions v0.4.0 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.10.0 @@ -11,10 +11,12 @@ require ( ) require ( + github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/uuid v1.6.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index ef5c5ad..6cb4ee7 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -5,12 +6,13 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/matzefriedrich/cobra-extensions v0.3.2 h1:W0xk7bi4dkhdz65VKB4+j5ujkYFk10kNwgTvUH9Qs60= -github.com/matzefriedrich/cobra-extensions v0.3.2/go.mod h1:XBV2/+r7q5p1UBJN4nIayR7gpm1SJEruWk+YZCVJXUE= +github.com/matzefriedrich/cobra-extensions v0.4.0 h1:ZJPfB+kmLTU0kCyNVFjAucV+Iexsr6c7ThYIuOCXR0s= +github.com/matzefriedrich/cobra-extensions v0.4.0/go.mod h1:Pc316EctF1k3eI1aGQNDGaAMtvS6nKR04nIgrdrZvuM= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= diff --git a/internal/commands/generate_mocks_command.go b/internal/commands/generate_mocks_command.go index 684b14b..cbdd065 100644 --- a/internal/commands/generate_mocks_command.go +++ b/internal/commands/generate_mocks_command.go @@ -14,7 +14,7 @@ import ( ) type mocksGeneratorCommand struct { - use types.CommandName `flag:"mocks" short:"Generate configurable mocks for interface types."` + use types.CommandName `flag:"mocks" short:"Generate configurable mocks for interface types." long:"Generates fully configurable mock implementations for Go interface types. It simplifies the process of creating mocks by analyzing the source code and automatically generating mock structs that adhere to the defined interfaces."` fileAccessor reflection.AstFileAccessor outputWriterFactory generator.OutputWriterFactory } diff --git a/internal/commands/generate_proxy_command.go b/internal/commands/generate_proxy_command.go index 17ce262..7af5f43 100644 --- a/internal/commands/generate_proxy_command.go +++ b/internal/commands/generate_proxy_command.go @@ -11,7 +11,7 @@ import ( ) type generateProxyCommand struct { - use types.CommandName `flag:"proxy" short:"Generate generic proxy types for method call interception."` + use types.CommandName `flag:"proxy" short:"Generate generic proxy types for method call interception." long:"Generates generic proxy types designed for method call interception on Go interfaces. These proxies act as intermediaries, allowing you to inject custom behavior—such as logging, validation, or transformation—before or after method execution."` fileAccessor reflection.AstFileAccessor outputWriterFactory generator.OutputWriterFactory } diff --git a/internal/commands/generator_command.go b/internal/commands/generator_command.go index 8bce41b..7e374b0 100644 --- a/internal/commands/generator_command.go +++ b/internal/commands/generator_command.go @@ -7,7 +7,7 @@ import ( ) type generatorCommand struct { - use types.CommandName `flag:"generate" short:"Generate boilerplate code for advanced DI features."` + use types.CommandName `flag:"generate" short:"Generate boilerplate code for advanced DI features" long:"A command group providing tools for creating boilerplate code to support advanced dependency injection (DI) features. It serves as a hub for related subcommands, such as generating mocks, proxies, or other utility types, streamlining the setup of DI patterns and improving developer productivity in complex Go projects."` } func (g *generatorCommand) Execute() { @@ -18,5 +18,5 @@ var _ types.TypedCommand = &generatorCommand{} func NewGenerateGroupCommand() *cobra.Command { command := &generatorCommand{} - return commands.CreateTypedCommand(command) + return commands.CreateTypedCommand(command, commands.NonRunnable) } diff --git a/internal/commands/init_command.go b/internal/commands/init_command.go index b9523f8..09b0ce9 100644 --- a/internal/commands/init_command.go +++ b/internal/commands/init_command.go @@ -20,7 +20,7 @@ type ScaffoldingFileWriterFactoryFunc func(projectFolder string) (generator.Scaf type ProjectLoaderFunc func(projectFolderPath string) (generator.GoProject, error) type initCommand struct { - use types.CommandName `flag:"init" short:"Add Parsley to an application"` + use types.CommandName `flag:"init" short:"Add Parsley to an application" long:"Integrates Parsley into an existing application by setting up the necessary scaffolding for dependency injection and code generation. It initializes project configurations, generates essential files, and prepares the application for using Parsley's advanced features."` fileWriterFactoryFunc ScaffoldingFileWriterFactoryFunc projectLoadFunc ProjectLoaderFunc }