MCPcopy
hub / github.com/larksuite/cli / LoadLegacyCommandErrorAllowlistWithDiagnostics

Function LoadLegacyCommandErrorAllowlistWithDiagnostics

lint/errscontract/scan.go:223–238  ·  view source on GitHub ↗
(root string)

Source from the content-addressed store, hash-verified

221}
222
223func 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
240func changedFilesFrom(root, from string) (map[string]bool, error) {
241 files := map[string]bool{}

Callers 2

ScanRepoWithOptionsFunction · 0.85

Calls 2

ReadFileMethod · 0.65

Tested by

no test coverage detected