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

Function is_generated_diff_skip_path

atomic-cli/src/commands/git/parallel.rs:282–326  ·  view source on GitHub ↗
(path: &str)

Source from the content-addressed store, hash-verified

280}
281
282fn 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
328fn count_line_units(content: &[u8]) -> usize {
329 if content.is_empty() {

Callers 5

build_graph_first_changeFunction · 0.85
write_commitMethod · 0.85

Calls 2

file_nameMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected