Skip to content

Commit 815deb7

Browse files
committed
legacy: removed i18n on unneded message
1 parent 5880d01 commit 815deb7

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

legacy/builder/builder_utils/utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ func PrepareCommandForRecipe(ctx *types.Context, buildProperties *properties.Map
512512
commandLine = properties.DeleteUnexpandedPropsFromString(commandLine)
513513
}
514514

515-
command, err := utils.PrepareCommand(commandLine, logger)
515+
command, err := utils.PrepareCommand(commandLine)
516516

517517
// if the overall commandline is too long for the platform
518518
// try reducing the length by making the filenames relative

legacy/builder/constants/constants.go

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ const MSG_BUILD_OPTIONS_CHANGED = "Build options changed, rebuilding all"
9090
const MSG_CANT_FIND_SKETCH_IN_PATH = "Unable to find {0} in {1}"
9191
const MSG_FQBN_INVALID = "{0} is not a valid fully qualified board name. Required format is targetPackageName:targetPlatformName:targetBoardName."
9292
const MSG_FIND_INCLUDES_FAILED = "Error while detecting libraries included by {0}"
93-
const MSG_INVALID_QUOTING = "Invalid quoting: no closing [{0}] char found."
9493
const MSG_LIB_LEGACY = "(legacy)"
9594
const MSG_LIBRARIES_MULTIPLE_LIBS_FOUND_FOR = "Multiple libraries were found for \"{0}\""
9695
const MSG_LIBRARIES_NOT_USED = " Not used: {0}"

legacy/builder/ctags_runner.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (s *CTagsRunner) Run(ctx *types.Context) error {
4141
}
4242

4343
commandLine := properties.ExpandPropsInString(pattern)
44-
command, err := utils.PrepareCommand(commandLine, logger)
44+
command, err := utils.PrepareCommand(commandLine)
4545
if err != nil {
4646
return errors.WithStack(err)
4747
}

legacy/builder/preprocess_sketch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (s *ArduinoPreprocessorRunner) Run(ctx *types.Context) error {
106106
}
107107

108108
commandLine := properties.ExpandPropsInString(pattern)
109-
command, err := utils.PrepareCommand(commandLine, logger)
109+
command, err := utils.PrepareCommand(commandLine)
110110
if err != nil {
111111
return errors.WithStack(err)
112112
}

legacy/builder/test/utils_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
package test
1717

1818
import (
19-
"github.com/arduino/arduino-cli/legacy/builder/i18n"
20-
"github.com/arduino/arduino-cli/legacy/builder/utils"
21-
"github.com/stretchr/testify/require"
2219
"strings"
2320
"testing"
21+
22+
"github.com/arduino/arduino-cli/legacy/builder/utils"
23+
"github.com/stretchr/testify/require"
2424
)
2525

2626
func TestCommandLineParser(t *testing.T) {
2727
command := "\"/home/federico/materiale/works_Arduino/Arduino/build/hardware/tools/coan\" source -m -E -P -kb -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=010600 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER=' '-DUSB_PRODUCT=\"Arduino Leonardo\"' \"/tmp/sketch321469072.cpp\""
2828

29-
parts, err := utils.ParseCommandLine(command, i18n.HumanLogger{})
29+
parts, err := utils.ParseCommandLine(command)
3030
NoError(t, err)
3131

3232
require.Equal(t, 23, len(parts))
@@ -78,7 +78,7 @@ func TestPrintableCommand(t *testing.T) {
7878
func TestCommandLineParserError(t *testing.T) {
7979
command := "\"command missing quote"
8080

81-
_, err := utils.ParseCommandLine(command, i18n.HumanLogger{})
81+
_, err := utils.ParseCommandLine(command)
8282
require.Error(t, err)
8383
}
8484

legacy/builder/utils/utils.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ import (
3131

3232
"github.com/arduino/arduino-cli/legacy/builder/constants"
3333
"github.com/arduino/arduino-cli/legacy/builder/gohasissues"
34-
"github.com/arduino/arduino-cli/legacy/builder/i18n"
3534
"github.com/arduino/arduino-cli/legacy/builder/types"
3635
paths "github.com/arduino/go-paths-helper"
3736
"github.com/pkg/errors"
3837
"golang.org/x/text/transform"
3938
"golang.org/x/text/unicode/norm"
4039
)
4140

42-
func ParseCommandLine(input string, logger i18n.Logger) ([]string, error) {
41+
func ParseCommandLine(input string) ([]string, error) {
4342
var parts []string
4443
escapingChar := constants.EMPTY_STRING
4544
escapedArg := constants.EMPTY_STRING
@@ -74,7 +73,7 @@ func ParseCommandLine(input string, logger i18n.Logger) ([]string, error) {
7473
}
7574

7675
if escapingChar != constants.EMPTY_STRING {
77-
return nil, i18n.ErrorfWithLogger(logger, constants.MSG_INVALID_QUOTING, escapingChar)
76+
return nil, errors.Errorf("Invalid quoting: no closing [%s] char found.", escapingChar)
7877
}
7978

8079
return parts, nil
@@ -189,8 +188,8 @@ func TrimSpace(value string) string {
189188
return strings.TrimSpace(value)
190189
}
191190

192-
func PrepareCommand(pattern string, logger i18n.Logger) (*exec.Cmd, error) {
193-
parts, err := ParseCommandLine(pattern, logger)
191+
func PrepareCommand(pattern string) (*exec.Cmd, error) {
192+
parts, err := ParseCommandLine(pattern)
194193
if err != nil {
195194
return nil, errors.WithStack(err)
196195
}

0 commit comments

Comments
 (0)