cloudbeat
cloudbeat copied to clipboard
Enable revive linter
Motivation The revive linter offers various checks for Go best-practices and common bugs and can help with code consistency and code review. It is currently disabled in our golangci.yml.
Definition of done What needs to be completed at the end of this task
- [x] Enable the revive linter
- [x] Investigate which rules are beneficial and enable them gradually, fixing any findings in the process
Rules:
- [x] ~~add-constant~~
- [x] argument-limit
- [x] atomic
- [x] ~~banned-characters~~
- [x] ~~bare-return~~
- [ ] blank-imports
- [x] bool-literal-in-expr
- [x] call-to-gc
- [x] cognitive-complexity
- [x] comment-spacings
- [ ] confusing-naming
- [x] confusing-results
- [x] constant-logical-expr
- [x] context-as-argument
- [x] context-keys-type
- [x] cyclomatic
- [x] datarace
- [x] deep-exit
- [x] defer
- [x] dot-imports
- [x] duplicated-imports
- [x] early-return
- [x] empty-block
- [x] empty-lines
- [ ] enforce-map-style
- [ ] enforce-slice-style
- [x] error-naming
- [x] error-return
- [x] error-strings
- [x] errorf
- [ ] exported
- [x] file-header: already covered elsewhere
- [x] flag-parameter
- [ ] function-length
- [x] function-result-limit
- [ ] get-return
- [x] identical-branches
- [x] if-return
- [ ] import-alias-naming
- [ ] import-shadowing
- [x] imports-blacklist
- [x] increment-decrement
- [x] indent-error-flow
- [x] ~~line-length-limit~~
- [x] ~~max-public-structs~~
- [x] modifies-parameter
- [x] modifies-value-receiver
- [x] nested-structs
- [x] optimize-operands-order
- [x] package-comments
- [x] range-val-address
- [x] range-val-in-closure
- [x] range
- [x] receiver-naming
- [x] redefines-builtin-id
- [x] redundant-import-alias
- [x] string-format
- [x] string-of-int
- [x] struct-tag
- [x] superfluous-else
- [x] time-equal
- [x] time-naming
- [ ] unchecked-type-assertion
- [x] unconditional-recursion
- [x] unexported-naming
- [x] unexported-return
- [x] unhandled-error
- [x] unnecessary-stmt
- [x] unreachable-code
- [x] unused-parameter
- [x] ~~unused-receiver~~
- [x] use-any
- [x] useless-break
- [x] var-declaration
- [ ] var-naming
- [x] waitgroup-by-value
@orestisfl can this be closed? there is no one assigned to it
@orestisfl can this be closed? there is no one assigned to it
The remaining 11 rules need to be configured or explicitly ignored, I am letting the cloudbeat team decide but I don't see a reason to close the ticket.