dotted-ignore

Crates.iodotted-ignore
lib.rsdotted-ignore
version0.1.0
created_at2025-10-31 11:05:09.779679+00
updated_at2025-10-31 11:05:09.779679+00
descriptionA Rust library and CLI utility for **efficient directory walking with `.ignore`-style file exclusion** โ€” inspired by `.gitignore` behavior.
homepage
repositoryhttps://github.com/themahikaishar/dotted-ignore
max_upload_size
id1909870
size12,758
Mahi Kaishar (themahikaishar)

documentation

README

dotted-ignore

Crates.io License

A Rust library and CLI utility for efficient directory walking with .ignore-style file exclusion โ€” inspired by .gitignore behavior.


๐Ÿš€ Overview

dotted-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 .ignore files 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, dotted-ignore gives you the control you need.


โš™๏ธ Features

  • Mimics .gitignore scoped ignore behavior, supporting patterns like:
    • /target to ignore a folder only in the current scope
    • **/node_modules to 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 dotted-ignore to your Cargo.toml:

[dependencies]
dotted-ignore = "0.1"

๐Ÿ›  Usage

Example usage:

use dotted_ignore::walk_dir;

fn main() {
    let base_dir = std::env::current_dir().unwrap();

    walk_dir(base_dir.to_str().unwrap(), |entry| {
        let path = entry.path();
        if path.is_dir() {
            println!("Dir: {}", path.display());
        } else {
            println!("File: {}", path.display());
        }
    });
}

๐Ÿค 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 .ignore features 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 .gitignore feature support
  • Optimize performance with incremental parsing and caching
  • Add CLI tool for standalone usage
  • Support multi-platform path handling and Windows-style paths
Commit count: 0

cargo fmt