tailwindcss/crates/ignore
Robin Malfait 606438c6c3
rebase ignore crate from 0.4.24 to 0.4.33 (#20409)
This PR updates the vendored `ignore/` crate to make use of the upstream
improvements.

We can't fully use the native `ignore` crate yet because of the missing
functionality that we added ourselves. Our own changes are still marked
as `CHANGED:`

## Test plan

1. All tests should still pass [ci-all]

---

<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
2026-08-13 12:45:40 +02:00
..
examples rebase ignore crate from 0.4.24 to 0.4.33 (#20409) 2026-08-13 12:45:40 +02:00
src rebase ignore crate from 0.4.24 to 0.4.33 (#20409) 2026-08-13 12:45:40 +02:00
tests rebase ignore crate from 0.4.24 to 0.4.33 (#20409) 2026-08-13 12:45:40 +02:00
Cargo.toml rebase ignore crate from 0.4.24 to 0.4.33 (#20409) 2026-08-13 12:45:40 +02:00
COPYING Add @source not support (#17255) 2025-03-25 15:54:41 +01:00
LICENSE-MIT Add @source not support (#17255) 2025-03-25 15:54:41 +01:00
README.md Incorporate changes from latest ignore crate (#19148) 2025-10-20 09:49:40 -04:00
UNLICENSE Add @source not support (#17255) 2025-03-25 15:54:41 +01:00

ignore

The ignore crate provides a fast recursive directory iterator that respects various filters such as globs, file types and .gitignore files. This crate also provides lower level direct access to gitignore and file type matchers.

Build status

Dual-licensed under MIT or the UNLICENSE.

Documentation

https://docs.rs/ignore

Usage

Add this to your Cargo.toml:

[dependencies]
ignore = "0.4"

Example

This example shows the most basic usage of this crate. This code will recursively traverse the current directory while automatically filtering out files and directories according to ignore globs found in files like .ignore and .gitignore:

use ignore::Walk;

for result in Walk::new("./") {
    // Each item yielded by the iterator is either a directory entry or an
    // error, so either print the path or the error.
    match result {
        Ok(entry) => println!("{}", entry.path().display()),
        Err(err) => println!("ERROR: {}", err),
    }
}

Example: advanced

By default, the recursive directory iterator will ignore hidden files and directories. This can be disabled by building the iterator with WalkBuilder:

use ignore::WalkBuilder;

for result in WalkBuilder::new("./").hidden(false).build() {
    println!("{:?}", result);
}

See the documentation for WalkBuilder for many other options.