refactor(terminal): inline the column fitting and shorten doc comments

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 20:49:33 +02:00
1 parent dbe2d376fe
commit 1917fc7471
6 files changed
+37 -59

No files matched your search

+2 -4
View File
@@ -163,10 +163,8 @@ var (
wikiTitle = regexp.MustCompile(`\[title: (.+?)(?:\.md)?\]`)
)
// Classify names the resource of a failed request for the user: a 404 becomes a NotFoundError
// for kind key in scope, a refusal Gitea explains (archived repository, merged pull request,
// existing resource, ...) becomes a ConflictError, and an unknown user the request named becomes
// a NotFoundError for that user. Other errors are returned unchanged.
// Classify names the resource of a failed request: a 404 or an unknown user becomes a
// NotFoundError, a refusal Gitea explains a ConflictError. Other errors are returned unchanged.
func Classify(err error, kind, key, scope string) error {
apiErr, ok := errors.AsType[*transport.APIError](err)
if !ok {
+3 -4
View File
@@ -41,10 +41,9 @@ func (s Labels) Find(ctx context.Context, raws []string, byName bool) ([]Label,
return result, nil
}
// CreateUnique creates a label unless existing, the labels of the scope, has one with its name,
// ignoring case. Then update edits that label with the supplied fields, keeping its name, and
// otherwise CreateUnique fails: Gitea would create a second label that name filters cannot tell
// apart. It reports whether it updated a label.
// CreateUnique creates a label unless existing has one with its name, ignoring case: Gitea would
// create a second label that name filters cannot tell apart. Then update edits that label, keeping
// its name, or CreateUnique fails. It reports whether it updated a label.
func (s Labels) CreateUnique(ctx context.Context, existing []Label, opts LabelOptions, update bool) (Label, bool, error) {
current, err := s.finder(true).Find(existing, deref(opts.Name))
if errors.As(err, new(*NotFoundError)) {