From 7f533927c76045cd7fec0bd9dac887eab8f94ffa Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 4 May 2017 14:28:04 +0200 Subject: [PATCH] add linter to exec --- drone/exec/exec.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drone/exec/exec.go b/drone/exec/exec.go index fc4f8495..d99d26ec 100644 --- a/drone/exec/exec.go +++ b/drone/exec/exec.go @@ -16,6 +16,7 @@ import ( "github.com/cncd/pipeline/pipeline/frontend" "github.com/cncd/pipeline/pipeline/frontend/yaml" "github.com/cncd/pipeline/pipeline/frontend/yaml/compiler" + "github.com/cncd/pipeline/pipeline/frontend/yaml/linter" "github.com/cncd/pipeline/pipeline/interrupt" "github.com/cncd/pipeline/pipeline/multipart" "github.com/drone/envsubst" @@ -325,6 +326,11 @@ func exec(c *cli.Context) error { volumes = append(volumes, dir+":"+path.Join(workspaceBase, workspacePath)) } + // lint the yaml file + if lerr := linter.New(linter.WithTrusted(true)).Lint(conf); lerr != nil { + return lerr + } + // compiles the yaml file compiled := compiler.New( compiler.WithEscalated(