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

Function is_test_command

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

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

(cmd: &str)

Source from the content-addressed store, hash-verified

248
249/// Returns `true` if the command looks like a test invocation.
250fn is_test_command(cmd: &str) -> bool {
251 let lower = cmd.to_lowercase();
252 let patterns = [
253 // Rust
254 "cargo test",
255 "cargo nextest",
256 // JavaScript / TypeScript
257 "npm test",
258 "npm run test",
259 "npx jest",
260 "npx vitest",
261 "npx mocha",
262 "bun test",
263 "yarn test",
264 "pnpm test",
265 "jest",
266 "vitest",
267 "mocha",
268 // Python
269 "pytest",
270 "python -m pytest",
271 "python -m unittest",
272 "python -m doctest",
273 // Go
274 "go test",
275 // Ruby
276 "rspec",
277 "rake test",
278 "bundle exec rspec",
279 // PHP
280 "phpunit",
281 "vendor/bin/phpunit",
282 // Elixir
283 "mix test",
284 // .NET
285 "dotnet test",
286 ];
287 patterns.iter().any(|p| lower.contains(p))
288}
289
290/// Returns `true` if the command looks like a lint invocation.
291fn is_lint_command(cmd: &str) -> bool {

Callers 1

classify_shell_commandFunction · 0.85

Calls 2

iterMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected