From 7bda02500bb3ee304bada6bb1e3d684495d04937 Mon Sep 17 00:00:00 2001 From: medmes Date: Thu, 28 Nov 2024 11:14:50 +0100 Subject: [PATCH] changes for the PR comment --- internal/common/validation/validation.go | 2 +- internal/service/contentprovider/securityconfig.go | 2 +- .../service/moduleconfig/reader/moduleconfig_reader_test.go | 2 +- internal/service/scaffold/options_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/common/validation/validation.go b/internal/common/validation/validation.go index 7a49377..5541ce1 100644 --- a/internal/common/validation/validation.go +++ b/internal/common/validation/validation.go @@ -117,7 +117,7 @@ func ValidateIsValidHTTPSURL(input string) error { func validateSemanticVersion(version string) error { _, err := semver.StrictNewVersion(strings.TrimSpace(version)) if err != nil { - return fmt.Errorf("opts.ModuleVersion failed to parse as semantic version: %w", + return fmt.Errorf("opts.ModuleVersion failed to be parsed as semantic version: %w", commonerrors.ErrInvalidOption) } diff --git a/internal/service/contentprovider/securityconfig.go b/internal/service/contentprovider/securityconfig.go index ad327da..b79d878 100644 --- a/internal/service/contentprovider/securityconfig.go +++ b/internal/service/contentprovider/securityconfig.go @@ -40,7 +40,7 @@ func (s *SecurityConfig) validateArgs(args types.KeyValueArgs) error { } if value == "" { - return fmt.Errorf("%s: %w must not be empty", ArgModuleName, ErrInvalidArg) + return fmt.Errorf("%s must not be empty: %w", ArgModuleName, ErrInvalidArg) } return nil diff --git a/internal/service/moduleconfig/reader/moduleconfig_reader_test.go b/internal/service/moduleconfig/reader/moduleconfig_reader_test.go index 2f2877a..fad614e 100644 --- a/internal/service/moduleconfig/reader/moduleconfig_reader_test.go +++ b/internal/service/moduleconfig/reader/moduleconfig_reader_test.go @@ -103,7 +103,7 @@ func Test_ValidateModuleConfig(t *testing.T) { "module-icon": "https://example.com/path/to/some-icon", }, }, - expectedError: fmt.Errorf("opts.ModuleVersion failed to parse as semantic version: %w", commonerrors.ErrInvalidOption), + expectedError: fmt.Errorf("opts.ModuleVersion failed to be parsed as semantic version: %w", commonerrors.ErrInvalidOption), }, { name: "invalid module namespace", diff --git a/internal/service/scaffold/options_test.go b/internal/service/scaffold/options_test.go index c69e1e2..c7d06cc 100644 --- a/internal/service/scaffold/options_test.go +++ b/internal/service/scaffold/options_test.go @@ -81,7 +81,7 @@ func Test_Validate_Options(t *testing.T) { ModuleVersion: "invalid", }, wantErr: true, - errMsg: "opts.ModuleVersion failed to parse as semantic version", + errMsg: "opts.ModuleVersion failed to be parsed as semantic version", }, { name: "ModuleConfigFileName is empty",