MCPcopy Create free account
hub / github.com/alibaba/open-code-review / parseBatchStrategy

Function parseBatchStrategy

internal/scan/batch.go:25–34  ·  view source on GitHub ↗

parseBatchStrategy normalizes a user-supplied strategy string. Unknown or empty values fall back to BatchNone (safe v1 behavior).

(s string)

Source from the content-addressed store, hash-verified

23// parseBatchStrategy normalizes a user-supplied strategy string. Unknown
24// or empty values fall back to BatchNone (safe v1 behavior).
25func parseBatchStrategy(s string) BatchStrategy {
26 switch BatchStrategy(strings.ToLower(strings.TrimSpace(s))) {
27 case BatchByLanguage:
28 return BatchByLanguage
29 case BatchByDirectory:
30 return BatchByDirectory
31 default:
32 return BatchNone
33 }
34}
35
36// groupBatches partitions items according to strategy, then slices each
37// natural group into BatchSize-sized chunks (when size > 0). Within a batch

Callers 2

TestParseBatchStrategyFunction · 0.85
resolveBatchStrategyMethod · 0.85

Calls 1

BatchStrategyTypeAlias · 0.85

Tested by 1

TestParseBatchStrategyFunction · 0.68