Skip to content

Commit

Permalink
Feature/update cobra extensions v0.4.0 (#40)
Browse files Browse the repository at this point in the history
* Update dependencies
* Adds detailed descriptions to command flags
* Updates long descriptions in command struct tags
  • Loading branch information
matzefriedrich authored Nov 27, 2024
1 parent 38dcceb commit ae943f0
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).


Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ 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
golang.org/x/mod v0.22.0
)

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
)
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
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=
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=
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/generate_mocks_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/generate_proxy_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions internal/commands/generator_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -18,5 +18,5 @@ var _ types.TypedCommand = &generatorCommand{}

func NewGenerateGroupCommand() *cobra.Command {
command := &generatorCommand{}
return commands.CreateTypedCommand(command)
return commands.CreateTypedCommand(command, commands.NonRunnable)
}
2 changes: 1 addition & 1 deletion internal/commands/init_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit ae943f0

Please sign in to comment.