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

Function fix

cmd/vale/command.go:63–88  ·  view source on GitHub ↗
(args []string, flags *core.CLIFlags)

Source from the content-addressed store, hash-verified

61}
62
63func fix(args []string, flags *core.CLIFlags) error {
64 if len(args) != 1 {
65 return core.NewE100("fix", errors.New("one argument expected"))
66 }
67
68 alert := args[0]
69 if system.FileExists(args[0]) {
70 b, err := os.ReadFile(args[0])
71 if err != nil {
72 return err
73 }
74 alert = string(b)
75 }
76
77 cfg, err := core.ReadPipeline(flags, false)
78 if err != nil {
79 return err
80 }
81
82 resp, err := check.ParseAlert(alert, cfg)
83 if err != nil {
84 return err
85 }
86
87 return printJSON(resp)
88}
89
90func sync(_ []string, flags *core.CLIFlags) error {
91 cfg, err := core.ReadPipeline(flags, true)

Callers

nothing calls this directly

Calls 5

NewE100Function · 0.92
FileExistsFunction · 0.92
ReadPipelineFunction · 0.92
ParseAlertFunction · 0.92
printJSONFunction · 0.85

Tested by

no test coverage detected