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

Method should_include

atomic-core/src/output/repo/tree.rs:362–383  ·  view source on GitHub ↗

Check if a path should be included based on all filters. # Arguments `path` - Full path to check # Returns `true` if the path passes all filters.

(&self, path: &str)

Source from the content-addressed store, hash-verified

360 ///
361 /// `true` if the path passes all filters.
362 pub fn should_include(&self, path: &str) -> bool {
363 // Check prefix
364 if !self.matches_prefix(path) {
365 return false;
366 }
367
368 // Check exclude patterns
369 if self.is_excluded(path) {
370 return false;
371 }
372
373 // Check hidden
374 if !self.include_hidden {
375 if let Some(name) = path.rsplit('/').next() {
376 if Self::is_hidden_name(name) {
377 return false;
378 }
379 }
380 }
381
382 true
383 }
384
385 /// Get the depth of a path.
386 ///

Callers 1

collect_treeFunction · 0.45

Calls 3

is_excludedMethod · 0.80
matches_prefixMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected