CI/lint: enable some "revive" rules (#3041)

argument-limit
Warns when a function receives more parameters than the maximum set by the rule's configuration.

bare-return
Warns on bare (a.k.a. naked) returns

context-as-argument
By convention, context.Context should be the first parameter of a function.

duplicated-imports
It is possible to unintentionally import the same package twice.

modifies-parameter
A function that modifies its parameters can be hard to understand. It can also be misleading if the arguments are passed by value by the caller.

redundant-import-alias
This rule warns on redundant import aliases.

unreachable-code
This rule spots and proposes to remove unreachable code.
This commit is contained in:
mmetc 2024-05-31 16:45:47 +02:00 committed by GitHub
parent 8501f459c3
commit 89d02e9458
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 17 additions and 24 deletions

View file

@ -12,7 +12,6 @@ import (
"regexp"
"github.com/google/uuid"
"github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
)
@ -276,7 +275,7 @@ func (r *ReqDumpFilter) ToJSON() error {
}
// Generate a ParsedRequest from a http.Request. ParsedRequest can be consumed by the App security Engine
func NewParsedRequestFromRequest(r *http.Request, logger *logrus.Entry) (ParsedRequest, error) {
func NewParsedRequestFromRequest(r *http.Request, logger *log.Entry) (ParsedRequest, error) {
var err error
contentLength := r.ContentLength
if contentLength < 0 {