A library for parsing and matching ignore files, such as .gitignore, .dockerignore, etc.
Dependencies
pub struct Ignore { rules : Array[IgnoreRule] strict_path_check : Bool}
fn Ignore::Ignore(options? : IgnoreOptions) -> Ignore
fn Ignore::add(self : Ignore, pattern : String) -> Ignore
fn Ignore::add_file(self : Ignore, path : String) -> Ignore raise @moonbitlang/x/fs.IOErrorIOError
fn Ignore::add_lines(self : Ignore, patterns : String) -> Ignore
fn Ignore::add_patterns(self : Ignore, patterns : Array[String]) -> Ignore
fn Ignore::check_ignore(self : Ignore, pathname : String) -> MatchResult
fn Ignore::filter(self : Ignore, pathnames : Array[String]) -> Array[String]
fn Ignore::ignores(self : Ignore, pathname : String) -> Bool
fn Ignore::match_path(self : Ignore, pathname : String) -> MatchResult
pub struct IgnoreOptions { allow_relative_paths : Bool} derive(Eq, @moonbitlang/core/debug.DebugDebug)
impl Default for IgnoreOptions
fn default() -> IgnoreOptions
fn IgnoreOptions::IgnoreOptions(allow_relative_paths? : Bool) -> IgnoreOptions
pub struct IgnoreRule { raw : String pattern : String negative : Bool directory_only : Bool anchored : Bool has_slash : Bool segments : Array[String]} derive(Eq, @moonbitlang/core/debug.DebugDebug)
pub struct MatchResult { ignored : Bool unignored : Bool rule : IgnoreRule?} derive(Eq, @moonbitlang/core/debug.DebugDebug)
fn is_path_valid(pathname : String) -> Bool
Install
Powered by MoonBit
© 2026 mooncakes.io