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

Method is_excluded

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

Check if a path should be excluded. # Arguments `path` - Path to check # Returns `true` if the path matches any exclude pattern. # Example ```rust use atomic_core::output::repo::TreeCollectOptions; let opts = TreeCollectOptions::new().exclude("target/"); assert!(opts.is_excluded("target/debug/main")); assert!(!opts.is_excluded("src/main.rs")); ```

(&self, path: &str)

Source from the content-addressed store, hash-verified

319 /// assert!(!opts.is_excluded("src/main.rs"));
320 /// ```
321 pub fn is_excluded(&self, path: &str) -> bool {
322 for pattern in &self.exclude_patterns {
323 if path.starts_with(pattern) || path.contains(pattern) {
324 return true;
325 }
326 }
327 false
328 }
329
330 /// Check if a filename is hidden.
331 ///

Callers 1

should_includeMethod · 0.80

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected