ignore-check

Crates.ioignore-check
lib.rsignore-check
version0.2.1
sourcesrc
created_at2024-09-04 18:40:52.417948
updated_at2024-10-25 23:26:30.703122
descriptionCheck if a path is ignored
homepage
repositoryhttps://github.com/qtfkwk/ignore-check
max_upload_size
id1363643
size5,737
(qtfkwk)

documentation

README

About

Check if a path is ignored

The ignore crate's primary use case is walking a directory. It provides Gitignore and GitignoreBuilder to load .gitignore files but the usage is difficult.

This crate uses ignore but provides a much easier interface.

Usage

use ignore_check::{ignored, Ignore};

assert!(ignored("target").unwrap());
assert!(!ignored("src/lib.rs").unwrap());

// Use an `Ignore` to check multiple files under the same root directory:

let ignore = Ignore::new(".").unwrap();

assert!(ignore.check("target"));
assert!(!ignore.check("src/lib.rs"));
Commit count: 3

cargo fmt