rs-dot-ignore
A Rust library and CLI utility for efficient directory walking with .ignore-style file exclusion โ inspired by .gitignore behavior.
๐ Overview
rs-dot-ignore provides a flexible and extendable way to recursively walk directories while respecting ignore rules scoped per directory, just like .gitignore. It supports:
- Per-directory
.ignorefiles with scoped rules - Powerful glob-based pattern matching
- Support for relative and recursive ignore patterns
- Easily customizable callback for processing matched files/directories
Whether youโre building a file watcher, backup tool, or any utility that needs fine-grained file filtering, rs-dot-ignore gives you the control you need.
โ๏ธ Features
- Mimics
.gitignorescoped ignore behavior, supporting patterns like:/targetto ignore a folder only in the current scope**/node_modulesto ignore recursively everywhere- Relative patterns like
./build
- Efficient in-memory caching of ignore rules per directory
- Recursive walking with user-defined callback to process files/directories
- Easily extensible to support advanced features like negation and layered ignore files
๐ฆ Installation
Add rs-dot-ignore to your Cargo.toml:
[]
= "0.1"
๐ Usage
Example usage:
use walk_dir;
๐ค Contributing
Iโm excited to grow this project into a fast, robust, and fully featured .ignore implementation.
If you want to contribute, your help is welcome with:
- Optimizations and performance improvements
- Supporting
.ignorefeatures like negation (!pattern) - Adding tests and examples
- Bug fixes and documentation enhancements
Feel free to open issues or submit pull requests!
๐ฎ Roadmap
- Improve pattern parsing and add full
.gitignorefeature support - Optimize performance with incremental parsing and caching
- Add CLI tool for standalone usage
- Support multi-platform path handling and Windows-style paths