Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Org-wide linter fixes #1004

Merged
merged 11 commits into from
Sep 17, 2024
Merged

Org-wide linter fixes #1004

merged 11 commits into from
Sep 17, 2024

Conversation

roman-khimov
Copy link
Member

No description provided.

@roman-khimov roman-khimov added this to the v0.32.0 milestone Sep 13, 2024
@roman-khimov
Copy link
Member Author

Argh, make sync-tree. This complicates things considerably.

@roman-khimov roman-khimov marked this pull request as draft September 13, 2024 13:16
@carpawell carpawell requested review from carpawell and removed request for carpawell September 13, 2024 15:05
api/handler/put.go:132:4                     predeclared   variable min has same name as predeclared identifier
api/handler/put.go:133:4                     predeclared   variable max has same name as predeclared identifier

Signed-off-by: Roman Khimov <[email protected]>
api/response.go:116:14                       errorlint     type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors
api/response.go:234:14                       errorlint     type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors
api/s3errors/errors.go:1689:11               errorlint     type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors
api/handler/delete.go:145:9                  errorlint     type switch on error will fail on wrapped errors. Use errors.As to check for specific errors
api/handler/delete.go:230:20                 errorlint     type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors
internal/neofs/neofs.go:593:16               errorlint     type switch on error will fail on wrapped errors. Use errors.As to check for specific errors

Signed-off-by: Roman Khimov <[email protected]>
internal/neofs/tree.go:103:49                errorlint     non-wrapping format verb for fmt.Errorf. Use `%w` to format errors

Signed-off-by: Roman Khimov <[email protected]>
api/auth/signer/v4/chunked_reader.go:140:8   errorlint     comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error
api/auth/signer/v4/chunked_reader.go:179:13  errorlint     comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error
api/auth/signer/v4/chunked_reader.go:195:6   errorlint     comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error
cmd/s3-gw/service.go:23:20                   errorlint     comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error

Signed-off-by: Roman Khimov <[email protected]>
api/handler/locking_test.go:650:32   bodyclose     response body must be closed
...

Signed-off-by: Roman Khimov <[email protected]>
Interface-based function is just misleading here:

api/router.go:185:42                 contextcheck  Function `GetRequestID` should pass the context parameter
api/layer/container.go:41:25         contextcheck  Function `GetRequestID` should pass the context parameter
api/layer/container.go:100:25        contextcheck  Function `GetRequestID` should pass the context parameter
api/handler/locking_test.go:335:64   contextcheck  Function `NewReqInfo->GetRequestID` should pass the context parameter

Signed-off-by: Roman Khimov <[email protected]>
api/auth/center.go:208:31            contextcheck  Function `cloneRequest` should pass the context parameter

Signed-off-by: Roman Khimov <[email protected]>
cmd/s3-gw/app.go:478:16              contextcheck  Function `stopServices` should pass the context parameter
cmd/s3-gw/app.go:507:16              contextcheck  Function `stopServices` should pass the context parameter

Signed-off-by: Roman Khimov <[email protected]>
internal/neofs/neofs_test.go:225:33  contextcheck  Non-inherited new context, use function like `context.WithXXX` instead
internal/neofs/neofs_test.go:232:28  contextcheck  Non-inherited new context, use function like `context.WithXXX` instead

Signed-off-by: Roman Khimov <[email protected]>
api/router.go:137:20                contextcheck  Non-inherited new context, use function like `context.WithXXX` or `r.Context` instead

Signed-off-by: Roman Khimov <[email protected]>
api/handler/locking_test.go:335:21  contextcheck  Non-inherited new context, use function like `context.WithXXX` instead

Signed-off-by: Roman Khimov <[email protected]>
@roman-khimov
Copy link
Member Author

Suggest merging the fixes (they're good anyway), but not switching the the linter setup for now.

@roman-khimov roman-khimov marked this pull request as ready for review September 16, 2024 15:55
@roman-khimov roman-khimov changed the title Org-wide linter Org-wide linter fixes Sep 16, 2024
@roman-khimov roman-khimov merged commit e528a00 into master Sep 17, 2024
16 checks passed
@roman-khimov roman-khimov deleted the org-linter branch September 17, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants