Skip to content

Commit 6a47912

Browse files
committed
chore: align logging with expectations
1 parent f46377c commit 6a47912

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func checkAgainstScopes(logger *slog.Logger, titleScope string, scopes []string)
143143
return nil
144144
}
145145
}
146-
logger.Error("Scope not allowed", slog.String("scope", titleScope), slog.Any("allowedScopes", scopes))
146+
147147
return fmt.Errorf("scope '%s' is not allowed", titleScope)
148148
}
149149

@@ -152,10 +152,12 @@ func parseTypes(logger *slog.Logger, input string, fallback []string) []string {
152152
logger.Warn("No custom list of commit types passed, using fallback.")
153153
return fallback
154154
}
155+
155156
types := strings.Split(input, ",")
156157
for i := range types {
157158
types[i] = strings.TrimSpace(types[i])
158159
}
160+
159161
return types
160162
}
161163

@@ -164,9 +166,11 @@ func parseScopes(logger *slog.Logger, input string) []string {
164166
logger.Warn("No custom list of commit scopes passed, using fallback.")
165167
return []string{}
166168
}
169+
167170
scopes := strings.Split(input, ",")
168171
for i := range scopes {
169172
scopes[i] = strings.TrimSpace(scopes[i])
170173
}
174+
171175
return scopes
172176
}

0 commit comments

Comments
 (0)