hook up linter
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
|
||||
"github.com/drone-runners/drone-runner-docker/command/internal"
|
||||
"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/envsubst"
|
||||
"github.com/drone/runner-go/environ"
|
||||
@@ -77,6 +78,15 @@ func (c *compileCommand) 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