(path: &str)
| 2163 | } |
| 2164 | |
| 2165 | fn is_generated_diff_skip_path(path: &str) -> bool { |
| 2166 | let normalized = path.replace('\\', "/"); |
| 2167 | let name = Path::new(path) |
| 2168 | .file_name() |
| 2169 | .and_then(|s| s.to_str()) |
| 2170 | .unwrap_or(path); |
| 2171 | let lower_name = name.to_ascii_lowercase(); |
| 2172 | let lower_path = normalized.to_ascii_lowercase(); |
| 2173 | |
| 2174 | lower_name.ends_with(".lock") |
| 2175 | || lower_name.ends_with(".sum") |
| 2176 | || lower_name.ends_with(".min.css") |
| 2177 | || lower_name.ends_with(".min.js") |
| 2178 | || lower_name.ends_with(".map") |
| 2179 | || matches!( |
| 2180 | lower_name.as_str(), |
| 2181 | "package-lock.json" | "yarn.lock" | "pnpm-lock.yaml" | "npm-shrinkwrap.json" |
| 2182 | ) |
| 2183 | || matches!( |
| 2184 | Path::new(&lower_name) |
| 2185 | .extension() |
| 2186 | .and_then(|ext| ext.to_str()), |
| 2187 | Some( |
| 2188 | "png" |
| 2189 | | "jpg" |
| 2190 | | "jpeg" |
| 2191 | | "gif" |
| 2192 | | "webp" |
| 2193 | | "ico" |
| 2194 | | "bmp" |
| 2195 | | "tiff" |
| 2196 | | "woff" |
| 2197 | | "woff2" |
| 2198 | | "ttf" |
| 2199 | | "eot" |
| 2200 | | "otf" |
| 2201 | | "pdf" |
| 2202 | | "zip" |
| 2203 | | "gz" |
| 2204 | | "tgz" |
| 2205 | ) |
| 2206 | ) |
| 2207 | || lower_path.ends_with("/website/source/stylesheets/main.css") |
| 2208 | || lower_path == "website/source/stylesheets/main.css" |
| 2209 | } |
| 2210 | |
| 2211 | fn count_line_units(content: &[u8]) -> usize { |
| 2212 | if content.is_empty() { |
no test coverage detected