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

Function parseBatchStrategy

internal/scan/batch.go:28–37  ·  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

26// parseBatchStrategy normalizes a user-supplied strategy string. Unknown
27// or empty values fall back to BatchNone (safe v1 behavior).
28func parseBatchStrategy(s string) BatchStrategy {
29 switch BatchStrategy(strings.ToLower(strings.TrimSpace(s))) {
30 case BatchByLanguage:
31 return BatchByLanguage
32 case BatchByDirectory:
33 return BatchByDirectory
34 default:
35 return BatchNone
36 }
37}
38
39// groupBatches partitions items according to strategy, then slices each
40// 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