MCPcopy
hub / github.com/urfave/cli / LintActionFunc

Function LintActionFunc

scripts/build.go:632–651  ·  view source on GitHub ↗
(ctx context.Context, cmd *cli.Command)

Source from the content-addressed store, hash-verified

630}
631
632func LintActionFunc(ctx context.Context, cmd *cli.Command) error {
633 topDir := cmd.String("top-dir")
634 if err := os.Chdir(topDir); err != nil {
635 return err
636 }
637
638 out, err := sh(ctx, filepath.Join(topDir, ".local/bin/goimports"), "-l", ".")
639 if err != nil {
640 return err
641 }
642
643 if strings.TrimSpace(out) != "" {
644 fmt.Fprintln(cmd.ErrWriter, "# ---> goimports -l is non-empty:")
645 fmt.Fprintln(cmd.ErrWriter, out)
646
647 return errors.New("goimports needed")
648 }
649
650 return nil
651}
652
653func V3Diff(ctx context.Context, cmd *cli.Command) error {
654 if err := os.Chdir(cmd.String("top-dir")); err != nil {

Callers

nothing calls this directly

Calls 2

shFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected