Expand description
Core library for ignorefile.
Parses a .gitignore into a model that renders back to the original bytes,
so the ignore rules of a repository can be kept as reviewable configuration
instead of a hand-edited flat file.
The invariant every later phase is built on top of, and none may weaken, is
that render(parse(x)) == x byte for byte. .gitignore is order-dependent
and anchor-sensitive, so a model that normalizes its input changes which
files git ignores. See docs/ROADMAP.md.
Structs§
- Config
- A repository’s ignore rules, as reviewable configuration.
- GitIgnore
- A parsed
.gitignore. - Line
- One line, preserved verbatim.
- Rule
- One group of patterns, optionally preceded by its own comment.
- Section
- One commented group of rules, rendered under a
##header. - Target
- One ignore file’s worth of sections.
Enums§
- Error
- Everything that can go wrong reading, writing or converting a configuration.
- Format
- Which encoding a configuration is written in.
- Line
Kind - What a line does, per git’s own parser.
Constants§
- NAME_
LEVEL - Comment depth of the configuration’s own name:
### name. - SECTION_
LEVEL - Default comment depth of a section header:
## Section. - VERSION
- The only schema version this build understands.