hook up linter
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/drone-runners/drone-runner-docker/command/internal"
|
||||
"github.com/drone-runners/drone-runner-docker/engine"
|
||||
"github.com/drone-runners/drone-runner-docker/engine/compiler"
|
||||
"github.com/drone-runners/drone-runner-docker/engine/linter"
|
||||
"github.com/drone-runners/drone-runner-docker/engine/resource"
|
||||
"github.com/drone-runners/drone-runner-docker/runtime"
|
||||
"github.com/drone/drone-go/drone"
|
||||
@@ -95,6 +96,15 @@ func (c *execCommand) run(*kingpin.ParseContext) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// lint the pipeline and return an error if any
|
||||
// linting rules are broken
|
||||
lint := linter.New()
|
||||
opts := linter.Opts{Trusted: c.Repo.Trusted}
|
||||
err = lint.Lint(resource, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// compile the pipeline to an intermediate representation.
|
||||
comp := &compiler.Compiler{
|
||||
Pipeline: resource,
|
||||
|
||||
Reference in New Issue
Block a user