-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add validation for secret block #126
Conversation
Codecov Report
@@ Coverage Diff @@
## master #126 +/- ##
==========================================
- Coverage 95.96% 94.98% -0.98%
==========================================
Files 50 50
Lines 3147 3270 +123
==========================================
+ Hits 3020 3106 +86
- Misses 73 90 +17
- Partials 54 74 +20
|
yaml/secret.go
Outdated
return isInvalid, fmt.Errorf("failed compile: unable to annotate: %w", err) | ||
} | ||
|
||
// nolint:lll // ignore line length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
directive // nolint:lll // ignore line length
is unused for linter lll (nolintlint)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means the nolint
directive is not needed here, afaik
yaml/step.go
Outdated
"provided for step %s:\n%s\n ", step.Name, string(source)), | ||
) | ||
invalid = fmt.Errorf("%w: %s", invalid, | ||
fmt.Errorf("no commands, environment, parameters, secrets or template provided for step %s:\n%s\n ", step.Name, string(source))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
line is 132 characters (lll)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like we need a nolint
here, or break up the line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
yaml/secret.go
Outdated
return isInvalid, fmt.Errorf("failed compile: unable to annotate: %w", err) | ||
} | ||
|
||
// nolint:lll // ignore line length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means the nolint
directive is not needed here, afaik
yaml/step.go
Outdated
"provided for step %s:\n%s\n ", step.Name, string(source)), | ||
) | ||
invalid = fmt.Errorf("%w: %s", invalid, | ||
fmt.Errorf("no commands, environment, parameters, secrets or template provided for step %s:\n%s\n ", step.Name, string(source))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like we need a nolint
here, or break up the line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR is part of the work with the new Yaml library:
go-vela/community#9
This PR implements linting guidelines for the secret block. The checked fields follow the standard set by the schema.json in the latest release.