Add deprecation warnings (#2725)

This commit is contained in:
Anbraten
2023-11-04 15:30:47 +01:00
committed by GitHub
parent 33f9574dce
commit a0f2ee9506
9 changed files with 187 additions and 51 deletions

View File

@@ -167,7 +167,11 @@ func execWithAxis(c *cli.Context, file, repoPath string, axis matrix.Axis) error
}
// lint the yaml file
if lerr := linter.New(linter.WithTrusted(true)).Lint(confstr, conf); lerr != nil {
if lerr := linter.New(linter.WithTrusted(true)).Lint([]*linter.WorkflowConfig{{
File: path.Base(file),
RawConfig: confstr,
Workflow: conf,
}}); lerr != nil {
return lerr
}

View File

@@ -93,9 +93,16 @@ func lintFile(_ *cli.Context, file string) error {
return err
}
err = linter.New(linter.WithTrusted(true)).Lint(string(buf), c)
config := &linter.WorkflowConfig{
File: path.Base(file),
RawConfig: rawConfig,
Workflow: c,
}
// TODO: lint multiple files at once to allow checks for sth like "depends_on" to work
err = linter.New(linter.WithTrusted(true)).Lint([]*linter.WorkflowConfig{config})
if err != nil {
fmt.Printf("🔥 %s has errors:\n", output.String(path.Base(file)).Underline())
fmt.Printf("🔥 %s has errors:\n", output.String(config.File).Underline())
hasErrors := true
for _, err := range pipeline_errors.GetPipelineErrors(err) {