(path: &str)
| 280 | } |
| 281 | |
| 282 | fn is_generated_diff_skip_path(path: &str) -> bool { |
| 283 | let normalized = path.replace('\\', "/"); |
| 284 | let name = Path::new(path) |
| 285 | .file_name() |
| 286 | .and_then(|s| s.to_str()) |
| 287 | .unwrap_or(path); |
| 288 | let lower_name = name.to_ascii_lowercase(); |
| 289 | let lower_path = normalized.to_ascii_lowercase(); |
| 290 | |
| 291 | lower_name.ends_with(".lock") |
| 292 | || lower_name.ends_with(".sum") |
| 293 | || lower_name.ends_with(".min.css") |
| 294 | || lower_name.ends_with(".min.js") |
| 295 | || lower_name.ends_with(".map") |
| 296 | || matches!( |
| 297 | lower_name.as_str(), |
| 298 | "package-lock.json" | "yarn.lock" | "pnpm-lock.yaml" | "npm-shrinkwrap.json" |
| 299 | ) |
| 300 | || matches!( |
| 301 | Path::new(&lower_name) |
| 302 | .extension() |
| 303 | .and_then(|ext| ext.to_str()), |
| 304 | Some( |
| 305 | "png" |
| 306 | | "jpg" |
| 307 | | "jpeg" |
| 308 | | "gif" |
| 309 | | "webp" |
| 310 | | "ico" |
| 311 | | "bmp" |
| 312 | | "tiff" |
| 313 | | "woff" |
| 314 | | "woff2" |
| 315 | | "ttf" |
| 316 | | "eot" |
| 317 | | "otf" |
| 318 | | "pdf" |
| 319 | | "zip" |
| 320 | | "gz" |
| 321 | | "tgz" |
| 322 | ) |
| 323 | ) |
| 324 | || lower_path.ends_with("/website/source/stylesheets/main.css") |
| 325 | || lower_path == "website/source/stylesheets/main.css" |
| 326 | } |
| 327 | |
| 328 | fn count_line_units(content: &[u8]) -> usize { |
| 329 | if content.is_empty() { |
no test coverage detected