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

Function transform

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

Source from the content-addressed store, hash-verified

312}
313
314func transform(args []string, flags *core.CLIFlags) error {
315 if len(args) != 1 {
316 return core.NewE100("transform", errors.New("one argument expected"))
317 } else if !system.FileExists(args[0]) {
318 return fmt.Errorf("file not found: %s", args[0])
319 }
320
321 cfg, err := core.ReadPipeline(flags, false)
322 if err != nil {
323 return err
324 }
325
326 linter, err := lint.NewLinter(cfg)
327 if err != nil {
328 return err
329 }
330
331 f, err := core.NewFile(args[0], cfg)
332 if err != nil {
333 return err
334 }
335
336 out, err := linter.Transform(f)
337 if err != nil {
338 return err
339 }
340
341 fmt.Println(out)
342 return nil
343}
344
345func pathInfo(_ []string, flags *core.CLIFlags) error {
346 system := map[string][]string{}

Callers

nothing calls this directly

Calls 6

TransformMethod · 0.95
NewE100Function · 0.92
FileExistsFunction · 0.92
ReadPipelineFunction · 0.92
NewLinterFunction · 0.92
NewFileFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…