parseDiagnosticSeverityMap converts a plugin rule configuration map to map[string]Severity.
(value any)
| 425 | |
| 426 | // parseDiagnosticSeverityMap converts a plugin rule configuration map to map[string]Severity. |
| 427 | func parseDiagnosticSeverityMap(value any) map[string]Severity { |
| 428 | result := make(map[string]Severity) |
| 429 | switch m := value.(type) { |
| 430 | case *collections.OrderedMap[string, any]: |
| 431 | for k, v := range m.Entries() { |
| 432 | if s, ok := v.(string); ok { |
| 433 | result[k] = ParseSeverity(s) |
| 434 | } |
| 435 | } |
| 436 | case map[string]any: |
| 437 | for k, v := range m { |
| 438 | if s, ok := v.(string); ok { |
| 439 | result[k] = ParseSeverity(s) |
| 440 | } |
| 441 | } |
| 442 | } |
| 443 | return result |
| 444 | } |
| 445 | |
| 446 | // parseKeyPatterns converts a JSON array of key pattern objects to []KeyPattern. |
| 447 | func parseKeyPatterns(arr []any) []KeyPattern { |
no test coverage detected