mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
Configure wrapcheck linter to recognize wrapping done by kyaml's errors package
This commit is contained in:
@@ -110,6 +110,19 @@ linters-settings:
|
|||||||
gomnd:
|
gomnd:
|
||||||
ignored-functions:
|
ignored-functions:
|
||||||
- ioutil.WriteFile
|
- ioutil.WriteFile
|
||||||
|
wrapcheck:
|
||||||
|
ignoreSigs:
|
||||||
|
# defaults
|
||||||
|
- .Errorf(
|
||||||
|
- errors.New(
|
||||||
|
- errors.Unwrap(
|
||||||
|
- .Wrap(
|
||||||
|
- .Wrapf(
|
||||||
|
- .WithMessage(
|
||||||
|
- .WithMessagef(
|
||||||
|
- .WithStack(
|
||||||
|
# from kyaml's errors package
|
||||||
|
- .WrapPrefixf(
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
new-from-rev: c94b5d8f2 # enables us to enforce a larger set of linters for new code than pass on existing code
|
new-from-rev: c94b5d8f2 # enables us to enforce a larger set of linters for new code than pass on existing code
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ func LoadFunctionConfig(src *yaml.RNode, api interface{}) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.WrapPrefixf(err, "loading provided schema")
|
return errors.WrapPrefixf(err, "loading provided schema")
|
||||||
}
|
}
|
||||||
schemaValidationError = validate.AgainstSchema(schema, src, strfmt.Default)
|
schemaValidationError = errors.Wrap(validate.AgainstSchema(schema, src, strfmt.Default))
|
||||||
// don't return it yet--try to make it to custom validation stage to combine errors
|
// don't return it yet--try to make it to custom validation stage to combine errors
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ func LoadFunctionConfig(src *yaml.RNode, api interface{}) error {
|
|||||||
|
|
||||||
if d, ok := api.(Defaulter); ok {
|
if d, ok := api.(Defaulter); ok {
|
||||||
if err := d.Default(); err != nil {
|
if err := d.Default(); err != nil {
|
||||||
return err
|
return errors.Wrap(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user