File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ package main
2+
3+ import "strings"
4+
5+ // formatToolsetName converts a toolset ID to a human-readable name.
6+ // Used by both generate_docs.go and list_scopes.go for consistent formatting.
7+ func formatToolsetName (name string ) string {
8+ switch name {
9+ case "pull_requests" :
10+ return "Pull Requests"
11+ case "repos" :
12+ return "Repositories"
13+ case "code_security" :
14+ return "Code Security"
15+ case "secret_protection" :
16+ return "Secret Protection"
17+ case "orgs" :
18+ return "Organizations"
19+ default :
20+ // Fallback: capitalize first letter and replace underscores with spaces
21+ parts := strings .Split (name , "_" )
22+ for i , part := range parts {
23+ if len (part ) > 0 {
24+ parts [i ] = strings .ToUpper (string (part [0 ])) + part [1 :]
25+ }
26+ }
27+ return strings .Join (parts , " " )
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments