Skip to content

Commit 829fce8

Browse files
committed
Fix
Signed-off-by: Luke Massa <[email protected]>
1 parent 41acd7b commit 829fce8

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

server/core/config/parser_validator.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (p *ParserValidator) ParseRepoCfgData(repoCfgData []byte, globalCfg valid.G
111111
func (p *ParserValidator) ParseGlobalCfg(configFile string, defaultCfg valid.GlobalCfg) (valid.GlobalCfg, error) {
112112
configData, err := os.ReadFile(configFile) // nolint: gosec
113113
if err != nil {
114-
return valid.GlobalCfg{}, fmt.Errorf("unable to read %s file: %v", configFile, err)
114+
return valid.GlobalCfg{}, fmt.Errorf("unable to read %s file: %w", configFile, err)
115115
}
116116
if len(configData) == 0 {
117117
return valid.GlobalCfg{}, fmt.Errorf("file %s was empty", configFile)
@@ -200,7 +200,7 @@ func (p *ParserValidator) applyLegacyShellParsing(cfg *valid.RepoCfg) error {
200200
if s.StepName == "run" {
201201
split, err := shlex.Split(s.RunCommand)
202202
if err != nil {
203-
return fmt.Errorf("unable to parse %q: %v", s.RunCommand, err)
203+
return fmt.Errorf("unable to parse %q: %w", s.RunCommand, err)
204204
}
205205
s.RunCommand = strings.Join(split, " ")
206206
}

server/core/config/raw/autodiscover.go

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77

88
"github.com/bmatcuk/doublestar/v4"
99
validation "github.com/go-ozzo/ozzo-validation"
10-
"github.com/pkg/errors"
1110
"github.com/runatlantis/atlantis/server/core/config/valid"
1211
)
1312

server/core/config/raw/global_cfg.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (r Repo) Validate() error {
185185
}
186186
_, err := regexp.Compile(id[1 : len(id)-1])
187187
if err != nil {
188-
return fmt.Errorf("parsing: %s: %v", id, err)
188+
return fmt.Errorf("parsing: %s: %w", id, err)
189189
}
190190
return nil
191191
}
@@ -201,7 +201,7 @@ func (r Repo) Validate() error {
201201
withoutSlashes := branch[1 : len(branch)-1]
202202
_, err := regexp.Compile(withoutSlashes)
203203
if err != nil {
204-
return fmt.Errorf("parsing: %s: %v", branch, err)
204+
return fmt.Errorf("parsing: %s: %w", branch, err)
205205
}
206206
return nil
207207
}

server/core/config/raw/project.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (p Project) Validate() error {
7676
withoutSlashes := branch[1 : len(branch)-1]
7777
_, err := regexp.Compile(withoutSlashes)
7878
if err != nil {
79-
return fmt.Errorf("parsing: %s: %v", branch, err)
79+
return fmt.Errorf("parsing: %s: %w", branch, err)
8080
}
8181
return nil
8282
}

server/core/config/valid/repo_cfg.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
"github.com/bmatcuk/doublestar/v4"
1212
version "github.com/hashicorp/go-version"
13-
"github.com/pkg/errors"
1413
)
1514

1615
// RepoCfg is the atlantis.yaml config after it's been parsed and validated.
@@ -122,7 +121,7 @@ func (r RepoCfg) IsPathIgnoredForAutoDiscover(path string) (bool, error) {
122121
if err != nil {
123122
// Per documentation https://pkg.go.dev/github.com/bmatcuk/doublestar, this only
124123
// occurs if the pattern itself is invalid, and we already checked this when parsing raw config
125-
return false, fmt.Errorf("unexpectedly found invalid ignore pattern (this is a bug, should have been validated at startup): %v", err)
124+
return false, fmt.Errorf("unexpectedly found invalid ignore pattern (this is a bug, should have been validated at startup): %w", err)
126125
}
127126
if matches {
128127
return true, nil

0 commit comments

Comments
 (0)