chore: tidy comments that repeat the code or no longer match it (#72)
- Comments that only restate a name (sgr, fg, mdLink, the repo provider's starred and current-repo notes) are gone. - Stale ones match the code again: the repo package covers plain env files too, Launch runs argv, closeVersions no longer claims to move the cursor, and Check's fallback says why rather than naming a state no release had. - The doc for versionString was attached to pseudo; the backtick in SourcesView's doc was a string-concatenation leftover; openFailed's doc was garbled. - recentReleases sits next to latest, its user. - .gitignore drops the Go template's boilerplate and patterns for files this project doesn't make. Reviewed-on: #72 Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
This commit was merged in pull request #72.
This commit is contained in:
1 parent
b773dfe296
commit
1753630c73
11 files changed
+21
-48
No files matched your search
@@ -89,14 +89,9 @@ func (r Release) Notes(current string) string {
|
||||
return PlainLinks(strings.TrimSpace(notes))
|
||||
}
|
||||
|
||||
// recentReleases is how many releases Latest reads the changelogs of.
|
||||
const recentReleases = 10
|
||||
|
||||
// PlainLinks shows Markdown links as their text, for a terminal.
|
||||
func PlainLinks(s string) string { return mdLink.ReplaceAllString(s, "$1") }
|
||||
|
||||
// mdLink is a Markdown link, [text](url): the notes link PRs and commits,
|
||||
// and a terminal shows them as their text.
|
||||
var mdLink = regexp.MustCompile(`\[([^\]]+)\]\((https?://[^)\s]+)\)`)
|
||||
|
||||
// Client talks to the release servers.
|
||||
@@ -148,6 +143,9 @@ func (c *Client) Latest(ctx context.Context) (Release, error) {
|
||||
return Release{}, errors.Join(errs...)
|
||||
}
|
||||
|
||||
// recentReleases is how many releases Latest reads the changelogs of.
|
||||
const recentReleases = 10
|
||||
|
||||
func (c *Client) latest(ctx context.Context, repo string) (Release, error) {
|
||||
api, err := API(repo)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user