(path: &str)
| 393 | } |
| 394 | |
| 395 | fn is_generated_diff_skip_path(path: &str) -> bool { |
| 396 | let normalized = path.replace('\\', "/"); |
| 397 | let name = Path::new(path) |
| 398 | .file_name() |
| 399 | .and_then(|s| s.to_str()) |
| 400 | .unwrap_or(path); |
| 401 | let lower_name = name.to_ascii_lowercase(); |
| 402 | let lower_path = normalized.to_ascii_lowercase(); |
| 403 | |
| 404 | lower_name.ends_with(".lock") |
| 405 | || lower_name.ends_with(".sum") |
| 406 | || lower_name.ends_with(".min.css") |
| 407 | || lower_name.ends_with(".min.js") |
| 408 | || lower_name.ends_with(".map") |
| 409 | || matches!( |
| 410 | lower_name.as_str(), |
| 411 | "package-lock.json" | "yarn.lock" | "pnpm-lock.yaml" | "npm-shrinkwrap.json" |
| 412 | ) |
| 413 | || matches!( |
| 414 | Path::new(&lower_name) |
| 415 | .extension() |
| 416 | .and_then(|ext| ext.to_str()), |
| 417 | Some( |
| 418 | "png" |
| 419 | | "jpg" |
| 420 | | "jpeg" |
| 421 | | "gif" |
| 422 | | "webp" |
| 423 | | "ico" |
| 424 | | "bmp" |
| 425 | | "tiff" |
| 426 | | "woff" |
| 427 | | "woff2" |
| 428 | | "ttf" |
| 429 | | "eot" |
| 430 | | "otf" |
| 431 | | "pdf" |
| 432 | | "zip" |
| 433 | | "gz" |
| 434 | | "tgz" |
| 435 | ) |
| 436 | ) |
| 437 | || lower_path.ends_with("/website/source/stylesheets/main.css") |
| 438 | || lower_path == "website/source/stylesheets/main.css" |
| 439 | } |
| 440 | |
| 441 | fn count_line_units(content: &[u8]) -> usize { |
| 442 | if content.is_empty() { |
no test coverage detected