mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 19:38:23 +00:00 
			
		
		
		
	Add more linters to improve code readability (#19989)
Add nakedret, unconvert, wastedassign, stylecheck and nolintlint linters to improve code readability - nakedret - https://github.com/alexkohler/nakedret - nakedret is a Go static analysis tool to find naked returns in functions greater than a specified function length. - unconvert - https://github.com/mdempsky/unconvert - Remove unnecessary type conversions - wastedassign - https://github.com/sanposhiho/wastedassign - wastedassign finds wasted assignment statements. - notlintlint - Reports ill-formed or insufficient nolint directives - stylecheck - https://staticcheck.io/docs/checks/#ST - keep style consistent - excluded: [ST1003 - Poorly chosen identifier](https://staticcheck.io/docs/checks/#ST1003) and [ST1005 - Incorrectly formatted error string](https://staticcheck.io/docs/checks/#ST1005)
This commit is contained in:
		| @@ -197,7 +197,7 @@ func TestAccessTokenExchangeWithBasicAuth(t *testing.T) { | ||||
| 		"code_verifier": "N1Zo9-8Rfwhkt68r1r29ty8YwIraXR8eh_1Qwxg7yQXsonBt", // test PKCE additionally | ||||
| 	}) | ||||
| 	req.Header.Add("Authorization", "Basic ZGE3ZGEzYmEtOWExMy00MTY3LTg1NmYtMzg5OWRlMGIwMTM4OmJsYWJsYQ==") | ||||
| 	resp = MakeRequest(t, req, http.StatusBadRequest) | ||||
| 	MakeRequest(t, req, http.StatusBadRequest) | ||||
|  | ||||
| 	// missing header | ||||
| 	req = NewRequestWithValues(t, "POST", "/login/oauth/access_token", map[string]string{ | ||||
| @@ -206,7 +206,7 @@ func TestAccessTokenExchangeWithBasicAuth(t *testing.T) { | ||||
| 		"code":          "authcode", | ||||
| 		"code_verifier": "N1Zo9-8Rfwhkt68r1r29ty8YwIraXR8eh_1Qwxg7yQXsonBt", // test PKCE additionally | ||||
| 	}) | ||||
| 	resp = MakeRequest(t, req, http.StatusBadRequest) | ||||
| 	MakeRequest(t, req, http.StatusBadRequest) | ||||
| } | ||||
|  | ||||
| func TestRefreshTokenInvalidation(t *testing.T) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user