Skip to content

Commit

Permalink
Keep arguments sorted by name
Browse files Browse the repository at this point in the history
  • Loading branch information
inesusvet committed Nov 30, 2024
1 parent ed2dd78 commit df6b136
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion magefiles/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"fmt"
"os"
"path/filepath"
"sort"
"strings"

"github.com/facebookincubator/ttpforge/pkg/args"
Expand Down Expand Up @@ -235,7 +236,15 @@ func ConvertSchema(atomic AtomicSchema) []TTP {
// Populate Args for each step from the test's InputArguments
argumentTypeMapping := NewArgumentTypeMapping()
argumentReplacements := make(map[string]string, len(test.InputArguments))
for argName, inputArg := range test.InputArguments {

argNames := make([]string, 0, len(test.InputArguments))
for argName := range test.InputArguments {
argNames = append(argNames, argName)
}
sort.Strings(argNames)

for _, argName := range argNames {
inputArg := test.InputArguments[argName]
lowerCaseArgType := strings.ToLower(inputArg.Type)
typeValue, ok := argumentTypeMapping[lowerCaseArgType]
if !ok {
Expand Down

0 comments on commit df6b136

Please sign in to comment.