MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / is_build_command

Function is_build_command

atomic-agent/src/provenance/classify.rs:347–373  ·  view source on GitHub ↗

Returns `true` if the command looks like a build invocation.

(cmd: &str)

Source from the content-addressed store, hash-verified

345
346/// Returns `true` if the command looks like a build invocation.
347fn is_build_command(cmd: &str) -> bool {
348 let lower = cmd.to_lowercase();
349 let patterns = [
350 // Rust
351 "cargo build",
352 "cargo check",
353 // JavaScript / TypeScript — tsc alone (without --noEmit) is a build
354 "npm run build",
355 "yarn build",
356 "pnpm build",
357 "bun build",
358 // Go
359 "go build",
360 // General
361 "make",
362 "cmake",
363 // .NET
364 "dotnet build",
365 ];
366
367 // Special case: bare `tsc` without --noEmit is a build
368 if lower.contains("tsc") && !lower.contains("--noemit") {
369 return true;
370 }
371
372 patterns.iter().any(|p| lower.contains(p))
373}
374
375/// Returns `true` if the shell command is primarily reading/searching.
376fn is_read_command(cmd: &str) -> bool {

Callers 1

classify_shell_commandFunction · 0.85

Calls 2

containsMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected