3 unstable releases

0.2.1 Oct 25, 2024
0.2.0 Sep 4, 2024
0.1.0 Sep 4, 2024

#3 in #ignored

Download history 214/week @ 2024-08-30 59/week @ 2024-09-06 33/week @ 2024-09-13 17/week @ 2024-09-20 11/week @ 2024-09-27 3/week @ 2024-10-04 5/week @ 2024-10-18 156/week @ 2024-10-25 38/week @ 2024-11-01 12/week @ 2024-11-08 17/week @ 2024-11-15

225 downloads per month
Used in 3 crates (via sprint)

MIT license

4KB
63 lines

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"));

Dependencies

~4–12MB
~131K SLoC