MCPcopy Create free account
hub / github.com/vale-cli/vale / ParseAlert

Function ParseAlert

internal/check/action.go:37–53  ·  view source on GitHub ↗

ParseAlert returns a slice of suggestions for the given Vale alert.

(s string, cfg *core.Config)

Source from the content-addressed store, hash-verified

35
36// ParseAlert returns a slice of suggestions for the given Vale alert.
37func ParseAlert(s string, cfg *core.Config) (Solution, error) {
38 body := core.Alert{}
39 resp := Solution{}
40
41 err := json.Unmarshal([]byte(s), &body)
42 if err != nil {
43 return Solution{}, err
44 }
45
46 suggestions, err := FixAlert(body, cfg)
47 if err != nil {
48 resp.Error = err.Error()
49 }
50 resp.Suggestions = suggestions
51
52 return resp, nil
53}
54
55func FixAlert(alert core.Alert, cfg *core.Config) ([]string, error) {
56 action := alert.Action.Name

Callers 1

fixFunction · 0.92

Calls 1

FixAlertFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…