Skip to content

Commit

Permalink
chore: fix linter config and violations
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <[email protected]>
  • Loading branch information
sagikazarmark committed Jan 9, 2025
1 parent d066d8e commit c7fd962
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
23 changes: 13 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
run:
timeout: 4m
skip-dirs:
- storage/ent/db # generated ent code

linters-settings:
depguard:
rules:
deprecated:
deny:
- pkg: "io/ioutil"
desc: "The 'io/ioutil' package is deprecated. Use corresponding 'os' or 'io' functions instead."
rules:
deprecated:
deny:
- pkg: "io/ioutil"
desc: "The 'io/ioutil' package is deprecated. Use corresponding 'os' or 'io' functions instead."
gci:
local-prefixes: github.com/dexidp/dex
sections:
- standard
- default
- prefix(github.com/dexidp/dex)
goimports:
local-prefixes: github.com/dexidp/dex


linters:
disable-all: true
enable:
- depguard
- dogsled
- exhaustive
- exportloopref
- gci
- gochecknoinits
- gocritic
Expand Down Expand Up @@ -92,3 +91,7 @@ linters:
# - nestif
# - testpackage
# - wsl

issues:
exclude-dirs:
- storage/ent/db # generated ent code
2 changes: 1 addition & 1 deletion connector/saml/saml.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ func (p *provider) validateStatus(status *status) error {
if statusMessage != nil && statusMessage.Value != "" {
errorMessage += " -> " + statusMessage.Value
}
return fmt.Errorf(errorMessage)
return errors.New(errorMessage)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion server/introspectionhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (s *Server) getTokenFromRequest(r *http.Request) (string, TokenTypeEnum, er
return "", 0, newIntrospectBadRequestError(fmt.Sprintf("HTTP method is \"%s\", expected \"POST\".", r.Method))
} else if err := r.ParseForm(); err != nil {
return "", 0, newIntrospectBadRequestError("Unable to parse HTTP body, make sure to send a properly formatted form request body.")
} else if r.PostForm == nil || len(r.PostForm) == 0 {
} else if len(r.PostForm) == 0 {
return "", 0, newIntrospectBadRequestError("The POST body can not be empty.")
} else if !r.PostForm.Has("token") {
return "", 0, newIntrospectBadRequestError("The POST body doesn't contain 'token' parameter.")
Expand Down

0 comments on commit c7fd962

Please sign in to comment.