Returns `true` if the command looks like a lint invocation.
(cmd: &str)
| 289 | |
| 290 | /// Returns `true` if the command looks like a lint invocation. |
| 291 | fn 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. |
| 329 | fn is_typecheck_command(cmd: &str) -> bool { |
no test coverage detected