Crates.io | ignore-check |
lib.rs | ignore-check |
version | |
source | src |
created_at | 2024-09-04 18:40:52.417948 |
updated_at | 2024-12-05 02:16:35.321289 |
description | Check if a path is ignored |
homepage | |
repository | https://github.com/qtfkwk/ignore-check |
max_upload_size | |
id | 1363643 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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.
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"));