Skip to content

Commit

Permalink
chore(deps): bump extendio to 0.1.16, cobrass to 0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
plastikfan committed Apr 25, 2023
1 parent 418ce9b commit ed7ee72
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 8 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"linters",
"nakedret",
"nolintlint",
"pixa",
"prealloc",
"repotoken",
"sidewalk",
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/onsi/ginkgo/v2 v2.9.2
github.com/onsi/gomega v1.27.6
github.com/samber/lo v1.38.1
github.com/snivilised/extendio v0.1.14
github.com/snivilised/extendio v0.1.16
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.15.0
go.uber.org/zap v1.24.0
Expand Down Expand Up @@ -37,7 +37,7 @@ require (
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/nicksnyder/go-i18n/v2 v2.2.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/snivilised/cobrass v0.2.0
github.com/snivilised/cobrass v0.2.3
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,16 @@ github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/snivilised/cobrass v0.2.0 h1:3u6jK0KK+glrCGBIZQIbpyeGvATmaUrDhv9asEYKnzY=
github.com/snivilised/cobrass v0.2.0/go.mod h1:/IVkewm12jIhi9anbFKS+zSJH3HfZo7CWztwcXf8h/g=
github.com/snivilised/cobrass v0.2.2 h1:n7Gw4a81KbA1YsrpQgyGuF1/sXRMsnzq6FInGGxbeiA=
github.com/snivilised/cobrass v0.2.2/go.mod h1:w1K6g/p5wtpq6s8cOWmnBpv5b16JhZb5/V4LzzQKh44=
github.com/snivilised/cobrass v0.2.3 h1:uWnq6CWqqGdFyYMKVpk00+WGxh5NsPnc4D3JUVUXWfs=
github.com/snivilised/cobrass v0.2.3/go.mod h1:DFP2OYBZP12ZACrcRzgRGc9HezdyJh5VYlfpjrWRgYU=
github.com/snivilised/extendio v0.1.14 h1:Is47jRy2WeV21EM5dq1FiTBxAn2SP9GC5Pv0ckni57A=
github.com/snivilised/extendio v0.1.14/go.mod h1:SO4udqtdfNl/KTLG9GF8kHxoMiIhnvN/9xlqkCCC6VY=
github.com/snivilised/extendio v0.1.15 h1:blfskgPAkHnQCkR3XJyUl8ldFElmO3P/QQ9KETbqA8E=
github.com/snivilised/extendio v0.1.15/go.mod h1:SO4udqtdfNl/KTLG9GF8kHxoMiIhnvN/9xlqkCCC6VY=
github.com/snivilised/extendio v0.1.16 h1:pMu1ZFKDZwRl/DB2QHL9jH02JaZMm0ax+ZZ3AZxLUUU=
github.com/snivilised/extendio v0.1.16/go.mod h1:SO4udqtdfNl/KTLG9GF8kHxoMiIhnvN/9xlqkCCC6VY=
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
Expand Down
3 changes: 2 additions & 1 deletion src/app/command/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/samber/lo"
"github.com/snivilised/cobrass/src/assistant"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"golang.org/x/text/language"

Expand Down Expand Up @@ -166,7 +167,7 @@ func (b *Bootstrap) buildRootCommand(container *assistant.CobraContainer) {
Usage: xi18n.Text(i18n.RootCmdLangUsageTemplData{}),
Default: xi18n.DefaultLanguage.Get().String(),
AlternativeFlagSet: root.PersistentFlags(),
}, &paramSet.Native.Language, func(value string) error {
}, &paramSet.Native.Language, func(value string, _ *pflag.Flag) error {
_, err := language.Parse(value)
return err
})
Expand Down
6 changes: 3 additions & 3 deletions src/app/command/widget-cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func buildWidgetCommand(container *assistant.CobraContainer) *cobra.Command {
paramSet.BindValidatedString(
assistant.NewFlagInfo("directory", "d", defaultDirectory),
&paramSet.Native.Directory,
func(value string) error {
func(value string, _ *pflag.Flag) error {
// ideally, we should check if the Flag has been explicitly set
//
if value == defaultDirectory {
Expand All @@ -97,7 +97,7 @@ func buildWidgetCommand(container *assistant.CobraContainer) *cobra.Command {
paramSet.BindValidatedEnum(
assistant.NewFlagInfo("format", "f", "xml"),
&paramSet.Native.FormatEn.Source,
func(value string) error {
func(value string, _ *pflag.Flag) error {
if domain.OutputFormatEnumInfo.En(value) == domain.XMLFormatEn {
return nil
}
Expand All @@ -115,7 +115,7 @@ func buildWidgetCommand(container *assistant.CobraContainer) *cobra.Command {
paramSet.BindValidatedString(
assistant.NewFlagInfo("pattern", "p", ""),
&paramSet.Native.Pattern,
func(value string) error {
func(value string, _ *pflag.Flag) error {
result := strings.Contains(value, "P?<date>") ||
(strings.Contains(value, "P?<d>") && strings.Contains(value, "P?<m>") &&
strings.Contains(value, "P?<m>"))
Expand Down
45 changes: 43 additions & 2 deletions src/app/command/widget_cmd_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,55 @@
package command_test

import (
"fmt"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/snivilised/arcadia/src/app/command"
"github.com/snivilised/arcadia/src/i18n"
"github.com/snivilised/arcadia/src/internal/helpers"
xi18n "github.com/snivilised/extendio/i18n"
"github.com/snivilised/extendio/xfs/utils"

ci18n "github.com/snivilised/cobrass/src/assistant/i18n"
)

var _ = Describe("WidgetCmd", func() {
var _ = Describe("WidgetCmd", Ordered, func() {
var (
repo string
l10nPath string
)

BeforeAll(func() {
repo = helpers.Repo("../../..")
l10nPath = helpers.Path(repo, "src/test/data/l10n")
Expect(utils.FolderExists(l10nPath)).To(BeTrue(),
fmt.Sprintf("💥 l10Path: '%v' does not exist", l10nPath),
)
})

BeforeEach(func() {
xi18n.ResetTx()
err := xi18n.Use(func(uo *xi18n.UseOptions) {
uo.From = xi18n.LoadFrom{
Path: l10nPath,
Sources: xi18n.TranslationFiles{
i18n.ArcadiaSourceID: xi18n.TranslationSource{
Name: "pixa",
},

ci18n.CobrassSourceID: xi18n.TranslationSource{
Name: "cobrass",
},
},
}
})

if err != nil {
Fail(err.Error())
}
})

When("specified flags are valid", func() {
It("🧪 should: execute without error", func() {
Expand All @@ -27,7 +68,7 @@ var _ = Describe("WidgetCmd", func() {
})

When("specified flags are valid", func() {
It("🧪 should: execute without error", func() {
It("🧪 should: return error due to option validation failure", func() {
bootstrap := command.Bootstrap{
Detector: &DetectorStub{},
}
Expand Down

0 comments on commit ed7ee72

Please sign in to comment.