formatToolsetName converts a toolset ID to a human-readable name. Used by both generate_docs.go and list_scopes.go for consistent formatting.
(name string)
| 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 | } |
no outgoing calls
no test coverage detected