Skip to content

Commit

Permalink
ignore if go build
Browse files Browse the repository at this point in the history
  • Loading branch information
alingse committed Jul 1, 2024
1 parent 41f1cf9 commit 36f4363
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runner/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ func Run(repo string, jsonCfg string, yamlCfg string) {
return
}

err = runner.Build(ctx, cfg)
if err != nil {
log.Printf("build failed and exit %+v %s", err, err.Error())
return
}

outputs, err := runner.Run(ctx, cfg)
if err != nil {
log.Fatal("failed in run linter:", err)
Expand Down
9 changes: 9 additions & 0 deletions runner/run/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ func Prepare(ctx context.Context, cfg *Config) error {
return nil
}

func Build(ctx context.Context, cfg *Config) error {
cmd := exec.CommandContext(ctx, "go", "build", "./...")
cmd.Dir = cfg.RepoDir
if err := runCmd(cmd); err != nil {
return err
}
return nil
}

func Run(ctx context.Context, cfg *Config) ([]string, error) {
name, args := utils.SplitCommand(cfg.LinterCfg.LinterCommand)
args = append(args, "./...")
Expand Down

0 comments on commit 36f4363

Please sign in to comment.