Skip to content
Snippets Groups Projects
Unverified Commit c7fd9620 authored by Mark Sagi-Kazar's avatar Mark Sagi-Kazar
Browse files

chore: fix linter config and violations

parent d066d8ea
Branches
No related tags found
No related merge requests found
run: run:
timeout: 4m timeout: 4m
skip-dirs:
- storage/ent/db # generated ent code
linters-settings: linters-settings:
depguard: depguard:
rules: rules:
deprecated: deprecated:
deny: deny:
- pkg: "io/ioutil" - pkg: "io/ioutil"
desc: "The 'io/ioutil' package is deprecated. Use corresponding 'os' or 'io' functions instead." desc: "The 'io/ioutil' package is deprecated. Use corresponding 'os' or 'io' functions instead."
gci: gci:
local-prefixes: github.com/dexidp/dex sections:
- standard
- default
- prefix(github.com/dexidp/dex)
goimports: goimports:
local-prefixes: github.com/dexidp/dex local-prefixes: github.com/dexidp/dex
linters: linters:
disable-all: true disable-all: true
enable: enable:
- depguard - depguard
- dogsled - dogsled
- exhaustive - exhaustive
- exportloopref
- gci - gci
- gochecknoinits - gochecknoinits
- gocritic - gocritic
...@@ -92,3 +91,7 @@ linters: ...@@ -92,3 +91,7 @@ linters:
# - nestif # - nestif
# - testpackage # - testpackage
# - wsl # - wsl
issues:
exclude-dirs:
- storage/ent/db # generated ent code
...@@ -467,7 +467,7 @@ func (p *provider) validateStatus(status *status) error { ...@@ -467,7 +467,7 @@ func (p *provider) validateStatus(status *status) error {
if statusMessage != nil && statusMessage.Value != "" { if statusMessage != nil && statusMessage.Value != "" {
errorMessage += " -> " + statusMessage.Value errorMessage += " -> " + statusMessage.Value
} }
return fmt.Errorf(errorMessage) return errors.New(errorMessage)
} }
return nil return nil
} }
......
...@@ -170,7 +170,7 @@ func (s *Server) getTokenFromRequest(r *http.Request) (string, TokenTypeEnum, er ...@@ -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)) return "", 0, newIntrospectBadRequestError(fmt.Sprintf("HTTP method is \"%s\", expected \"POST\".", r.Method))
} else if err := r.ParseForm(); err != nil { } 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.") 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.") return "", 0, newIntrospectBadRequestError("The POST body can not be empty.")
} else if !r.PostForm.Has("token") { } else if !r.PostForm.Has("token") {
return "", 0, newIntrospectBadRequestError("The POST body doesn't contain 'token' parameter.") return "", 0, newIntrospectBadRequestError("The POST body doesn't contain 'token' parameter.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment