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

Function excludeToolDef

cmd/opencodereview/shared.go:230–239  ·  view source on GitHub ↗

excludeToolDef returns a copy of defs with any entries whose function name matches name removed. Used by `ocr scan` to hide tools that don't make sense in full-scan mode (e.g. file_read_diff).

(defs []llm.ToolDef, name string)

Source from the content-addressed store, hash-verified

228// matches name removed. Used by `ocr scan` to hide tools that don't make
229// sense in full-scan mode (e.g. file_read_diff).
230func excludeToolDef(defs []llm.ToolDef, name string) []llm.ToolDef {
231 out := make([]llm.ToolDef, 0, len(defs))
232 for _, d := range defs {
233 if d.Function.Name == name {
234 continue
235 }
236 out = append(out, d)
237 }
238 return out
239}
240
241// quietHandle wraps a stdout.Quiet() restorer so callers can `defer
242// q.Restore()` for safety while emitRunResult restores it early when the

Callers 3

TestExcludeToolDefFunction · 0.85
executeScanFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestExcludeToolDefFunction · 0.68