Parse and match gitignore-style rules.
Summary
Functions
Returns the matching rule, similar to git check-ignore -v.
Compiles rules into a matcher.
Returns true when the path is ignored.
Loads .gitignore files from root into a stack.
Parses ignore-file content into rules.
Functions
@spec check(Gitignore.Matcher.t(), binary(), keyword()) :: {:ignored | :unignored, Gitignore.Rule.t()} | :not_ignored
Returns the matching rule, similar to git check-ignore -v.
@spec compile( [Gitignore.Rule.t()], keyword() ) :: Gitignore.Matcher.t()
Compiles rules into a matcher.
@spec ignored?(Gitignore.Matcher.t(), binary(), keyword()) :: boolean()
Returns true when the path is ignored.
@spec load( Path.t(), keyword() ) :: {:ok, Gitignore.Stack.t()} | {:error, term()}
Loads .gitignore files from root into a stack.
@spec parse(binary()) :: [Gitignore.Rule.t()]
Parses ignore-file content into rules.