(root string)
| 221 | } |
| 222 | |
| 223 | func LoadLegacyCommandErrorAllowlistWithDiagnostics(root string) (LegacyCommandErrorAllowlist, []Violation, error) { |
| 224 | path := filepath.Join(root, "internal", "qualitygate", "config", "allowlists", "legacy-command-errors.txt") |
| 225 | data, err := os.ReadFile(path) //nolint:gosec // repo root is operator-provided. |
| 226 | if err != nil { |
| 227 | if os.IsNotExist(err) { |
| 228 | return LegacyCommandErrorAllowlist{}, nil, nil |
| 229 | } |
| 230 | return nil, nil, err |
| 231 | } |
| 232 | rel, err := filepath.Rel(root, path) |
| 233 | if err != nil { |
| 234 | rel = path |
| 235 | } |
| 236 | allow, diags := ParseLegacyCommandErrorAllowlistWithDiagnostics(string(data), filepath.ToSlash(rel)) |
| 237 | return allow, diags, nil |
| 238 | } |
| 239 | |
| 240 | func changedFilesFrom(root, from string) (map[string]bool, error) { |
| 241 | files := map[string]bool{} |
no test coverage detected