Documentation
¶
Overview ¶
Package post checks a report before it is posted with the Slack connector, whose message is standard Markdown it converts for Slack: that every pull request or issue it mentions is a link to that pull request or issue in its own repository, and that its times are the person's.
Index ¶
- func Check(text string) []string
- func Linked(text string, owners map[string]string, here string) string
- func Owners(repos ...string) map[string]string
- func Report(text string, zone *time.Location, now time.Time) []string
- func SingleRepo(text string) string
- func Unlinked(text, here string) []string
- func UnlinkedLines(text, here string) [][]string
- func Zone(text string, zone *time.Location, now time.Time) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check returns what is wrong with a report's links, one problem per entry; none: it passes.
func Linked ¶ added in v0.54.0
Linked rewrites text so it passes Check: every [owner/]repo#n or bare #n outside a link and a code span becomes a link to its issue, its owner the one owners has for the repository, a bare #n in here (owner/repo); a beekeeper note or timer is "note <n>"; a reference it cannot place loses its # ("repo 12").
func Owners ¶ added in v0.54.0
Owners maps each repository name of the owner/repo names to its owner, lowercased, for Linked.
func SingleRepo ¶ added in v0.171.0
SingleRepo returns the single owner/repo that text names by a full GitHub issue or pull request URL or an owner/repo#N reference, or "" when none or more than one.
func Unlinked ¶ added in v0.171.0
Unlinked lists the bare #N and owner/repo#N references in text (outside fenced code blocks, inline code spans, CSS colour literals and URLs) that have no matching full GitHub issue or pull request URL in text, each formatted as "<ref> without its full URL (<url>)". When here is "owner/repo" (or text links one repository), a bare #N names that repository in its URL.
func UnlinkedLines ¶ added in v0.171.0
UnlinkedLines returns, for each line of text (0-indexed), the unlinked #N and owner/repo#N references on that line, evaluated against the full document's code boundaries and linked URLs.
Types ¶
This section is empty.