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

Function is_lint_command

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

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

(cmd: &str)

Source from the content-addressed store, hash-verified

289
290/// Returns `true` if the command looks like a lint invocation.
291fn is_lint_command(cmd: &str) -> bool {
292 let lower = cmd.to_lowercase();
293 let patterns = [
294 // Rust
295 "cargo clippy",
296 "cargo fmt -- --check",
297 "cargo fmt --check",
298 // JavaScript / TypeScript
299 "eslint",
300 "npx eslint",
301 "prettier --check",
302 "npx prettier --check",
303 "biome check",
304 "biome lint",
305 "npm run lint",
306 "yarn lint",
307 "pnpm lint",
308 "oxlint",
309 // Python
310 "pylint",
311 "flake8",
312 "ruff check",
313 "ruff",
314 "mypy",
315 "pyright",
316 // Go
317 "golangci-lint",
318 "golint",
319 "go vet",
320 // Ruby
321 "rubocop",
322 // Shell
323 "shellcheck",
324 ];
325 patterns.iter().any(|p| lower.contains(p))
326}
327
328/// Returns `true` if the command looks like a type-check invocation.
329fn is_typecheck_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