Skip to main content

Crate use_git_ignore

Crate use_git_ignore 

Source
Expand description

§use-git-ignore

Primitive gitignore pattern vocabulary for RustUse.

use-git-ignore classifies gitignore-style lines as blank lines, comments, negated patterns, directory patterns, or ordinary patterns. It does not decide whether a filesystem path is ignored.

§Basic usage

use use_git_ignore::{GitIgnoreNegation, GitIgnoreRule};

let rule = GitIgnoreRule::parse("!target/").expect("valid ignore rule");

assert_eq!(rule.negation(), GitIgnoreNegation::Negated);
assert!(rule.is_directory_only());

§Scope

  • Classify pattern text, comments, blank lines, negation, and directory markers.
  • Keep filesystem walking and ignore matching out of scope.

Structs§

GitIgnorePattern
A non-empty ignore pattern.
GitIgnoreRule
A classified ignore rule.

Enums§

GitIgnoreNegation
Pattern negation vocabulary.
GitIgnoreParseError
Error returned while parsing ignore vocabulary.
GitIgnoreScope
Ignore rule classification.