refactor: reuse the existing service and rendering helpers

services.IsNotFound replaces the hand-rolled 404 checks, convertPage
the copied page conversions and lastPathNumber the comment's own
number parser. The List wrappers around ListPage of releases,
branches, wiki pages, secrets and variables go, pull request filters
resolve milestones through Milestones.FindOne like issues, and
localFlagsChanged, boolOrder, Cell.Render, stateBadge and dueText
replace their copies.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 11:22:52 +02:00
1 parent 29f62da006
commit 83924892ff
33 files changed
+85 -212

No files matched your search

+5 -3
View File
@@ -307,9 +307,11 @@ func argumentName(cmd *cobra.Command, argument string) string {
return noun + " " + text
}
// localFlagsChanged reports whether any command-specific flag was supplied.
func localFlagsChanged(cmd *cobra.Command) bool {
// localFlagsChanged reports whether a command-specific flag other than those in except was supplied.
func localFlagsChanged(cmd *cobra.Command, except ...string) bool {
changed := false
cmd.LocalNonPersistentFlags().VisitAll(func(flag *pflag.Flag) { changed = changed || flag.Changed })
cmd.LocalNonPersistentFlags().VisitAll(func(flag *pflag.Flag) {
changed = changed || flag.Changed && !slices.Contains(except, flag.Name)
})
return changed
}