-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix(linter): fix golangci-lint warnings across substation #32
Conversation
* handle or explicitly ignore all errors * remove redundant function calls/conversions * rename predeclared `caps` identifier * tools: gofmt -> gofumpt, and staticcheck -> golangci-lint
bccd004
to
5329bd6
Compare
process/pipeline.go
Outdated
if result.IsArray() { | ||
return cap, fmt.Errorf("process pipeline: inputkey %s: %v", p.InputKey, errPipelineArrayInput) | ||
return capsule, fmt.Errorf("process pipeline: inputkey %s: %v", p.InputKey, errPipelineArrayInput) | ||
} | ||
|
||
newCap := config.NewCapsule() |
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.
should this be newCapsule
to match the capsule
convention?
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.
Great point (and with newCapsules
as well)! Modified these instances across the project with the latest fixup.
process/pretty_print.go
Outdated
newCaps := newBatch(&caps) | ||
for _, cap := range caps { | ||
ok, err := op.Operate(ctx, cap) | ||
newCaps := newBatch(&capsules) |
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.
similar to the other comment, is newCapsules
preferred since we're changing the convention to capsule
?
process/copy.go
Outdated
JSON: | ||
{"hello":"world"} >>> {"hello":"world","goodbye":"world"} | ||
from JSON: | ||
{"hello":"world"} >>> world | ||
to JSON: | ||
world >>> {"hello":"world"} |
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.
docs: this indent seems to have an extra tab compared to comments for other processors? is this correct? 🤔
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.
Whoops, no this was accidental - removed this extra indentation with the latest fixup. Thanks for catching this!
this feels like an opinionated change (which is OK), but we should document it so that others know that the naming convention is |
Address code review comments. Changes include: - Undoing spurious whitespace changes - Rename variables with modifiers related to `cap` like newCap - Adding variable naming conventions to docs
Added a new section to the contributions docs to touch on avoiding predeclared identifiers and how we chose to use |
This updates the Go code lintng to use the meta-linter golangci-lint and fixes related lints.
Description
Changes include:
caps
identifierMotivation and Context
This closes #31, improves error handling and consistency across with project.
How Has This Been Tested?
Local builds, unit tests, and benchmarks all pass.
Types of changes
Checklist: