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
| return capsule, fmt.Errorf("process pipeline: inputkey %s: %v", p.InputKey, errPipelineArrayInput) | ||
| } | ||
|
|
||
| newCap := config.NewCapsule() |
There was a problem hiding this comment.
should this be newCapsule to match the capsule convention?
There was a problem hiding this comment.
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.
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.
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.
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:
capsidentifierMotivation 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: