Documentation
¶
Overview ¶
Package errata is the declared overlay of defects in the OMG-published material this project reads: what the published text says, the clause that makes it wrong, and what the oracles read instead. The published bytes on disk are never rewritten; corrections live only here.
Index ¶
- Constants
- func Apply(entry Entry, content []byte) ([]byte, error)
- type Entry
- type Overlay
- func (o *Overlay) Corrections() []Entry
- func (o *Overlay) Documented() []Entry
- func (o *Overlay) Entries() []Entry
- func (o *Overlay) Materialize(repo, dir, dst string) (map[string]Entry, error)
- func (o *Overlay) Rewrite(path string, content []byte) ([]byte, bool, error)
- func (o *Overlay) Under(dir string) map[string]Entry
- func (o *Overlay) Verify(repo string) (missing []string, err error)
Constants ¶
const IssuesPath = "docs/project/omg-issues.md"
IssuesPath is the page every entry must be documented in.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
// ID is the row in docs/project/omg-issues.md documenting the defect.
ID string
// Path is the defective file, relative to the repository root.
Path string
// Line is the 1-based line the entry covers.
Line int
// AsPublished is the published line, verbatim.
AsPublished string
// Corrected replaces AsPublished when non-empty. Empty means documented
// without a correction: nothing is substituted, and the defect stands.
Corrected string
// Citation is the specification clause the published text violates.
Citation string
// Derivation states in one line why that clause is violated.
Derivation string
}
Entry is one defect in published material. The span is one whole line: AsPublished is that line's exact bytes without its terminator, which is what lets a re-vendored corpus invalidate the entry instead of silently rotting it.
type Overlay ¶
type Overlay struct {
// contains filtered or unexported fields
}
Overlay is a registry indexed by file, ready to apply.
func (*Overlay) Corrections ¶
Corrections returns the entries that substitute text.
func (*Overlay) Documented ¶
Documented returns the entries documented without a correction.
func (*Overlay) Materialize ¶
Materialize copies the corpus root at repo/dir into dst and applies every correction inside it, leaving the published tree untouched. It returns the applied entries, keyed by the path relative to the root.
func (*Overlay) Rewrite ¶
Rewrite applies the entry covering a repository-relative path, if any. It returns the content unchanged for a file no entry corrects.