#path #ignored #directory #ignore #gitignore

ignore-check

Check if a path is ignored

8 releases

Uses new Rust 2024

new 0.3.1 Oct 27, 2025
0.3.0 Aug 28, 2025
0.2.4 Apr 16, 2025
0.2.3 Feb 20, 2025
0.1.0 Sep 4, 2024

#762 in Filesystem

Download history 39/week @ 2025-07-06 33/week @ 2025-07-13 38/week @ 2025-07-20 28/week @ 2025-07-27 21/week @ 2025-08-03 28/week @ 2025-08-10 20/week @ 2025-08-17 141/week @ 2025-08-24 98/week @ 2025-08-31 63/week @ 2025-09-07 56/week @ 2025-09-14 34/week @ 2025-09-21 67/week @ 2025-09-28 39/week @ 2025-10-05 38/week @ 2025-10-12 27/week @ 2025-10-19

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

MIT license

5KB
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

~3.5–7MB
~128K SLoC