mirror of
https://codeberg.org/crowci/crow.git
synced 2025-08-09 07:42:52 +03:00
Use variables in pipeline (#1026)
use yaml aliases (https://yaml.org/spec/1.2.2/#3222-anchors-and-aliases) to have pipeline `variables` Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com> Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
@@ -26,7 +26,8 @@ func lint(c *cli.Context) error {
|
||||
}
|
||||
|
||||
func lintDir(c *cli.Context, dir string) error {
|
||||
return filepath.Walk(dir, func(path string, info os.FileInfo, e error) error {
|
||||
var errorStrings []string
|
||||
if err := filepath.Walk(dir, func(path string, info os.FileInfo, e error) error {
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
@@ -34,13 +35,22 @@ func lintDir(c *cli.Context, dir string) error {
|
||||
// check if it is a regular file (not dir)
|
||||
if info.Mode().IsRegular() && strings.HasSuffix(info.Name(), ".yml") {
|
||||
fmt.Println("#", info.Name())
|
||||
_ = lintFile(c, path) // TODO: should we drop errors or store them and report back?
|
||||
if err := lintFile(c, path); err != nil {
|
||||
errorStrings = append(errorStrings, err.Error())
|
||||
}
|
||||
fmt.Println("")
|
||||
return nil
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(errorStrings) != 0 {
|
||||
return fmt.Errorf("ERRORS: %s", strings.Join(errorStrings, "; "))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func lintFile(_ *cli.Context, file string) error {
|
||||
|
Reference in New Issue
Block a user