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

add linter and fix discovered issues #14

Merged
merged 3 commits into from
Jun 24, 2024
Merged

add linter and fix discovered issues #14

merged 3 commits into from
Jun 24, 2024

Conversation

okdas
Copy link
Member

@okdas okdas commented Jun 21, 2024

Summary

Adds golangci-lint and fixes discovered by linter issues.

Issue

Type of change

Select one or more:

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Documentation
  • Other (specify)

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have commented my code
  • I have performed a self-review of my own code; both comments & source code
  • I create and reference any new tickets, if applicable
  • I have left TODOs throughout the codebase, if applicable

@okdas
Copy link
Member Author

okdas commented Jun 21, 2024

Issues discovered by linter and addressed in this PR. I kept the same configuration we have in the poktroll repo (but adopted for the newer version of the linter):

types/request.go:51:5: shadow: declaration of "err" shadows declaration at line 48 (govet)
        if err := proto.Unmarshal(requestBz, poktHTTPRequest); err != nil {
           ^
types/response.go:54:5: shadow: declaration of "err" shadows declaration at line 51 (govet)
        if err := proto.Unmarshal(responseBz, poktHTTPResponse); err != nil {
           ^
sdk/sdk.go:147:5: shadow: declaration of "err" shadows declaration at line 146 (govet)
        if err := sessionSupplierEndpoint.SessionHeader.ValidateBasic(); err != nil {
           ^
sdk/sdk.go:182:5: shadow: declaration of "err" shadows declaration at line 146 (govet)
        if err := relayResponse.Unmarshal(relayResponseBz); err != nil {
           ^
sdk/sdk.go:186:5: shadow: declaration of "err" shadows declaration at line 146 (govet)
        if err := relayResponse.ValidateBasic(); err != nil {
           ^
block_test.go:8:1: tests: ExampleLatestBlockHeight refers to unknown identifier: LatestBlockHeight (govet)
func ExampleLatestBlockHeight() {
^

@okdas okdas self-assigned this Jun 21, 2024
@okdas okdas added the CI label Jun 21, 2024
@okdas
Copy link
Member Author

okdas commented Jun 21, 2024

@okdas okdas requested a review from red-0ne June 21, 2024 23:11
@okdas okdas marked this pull request as ready for review June 21, 2024 23:17
Copy link
Collaborator

@red-0ne red-0ne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks @okdas

@okdas okdas merged commit 99f5f56 into main Jun 24, 2024
7 checks passed
@okdas okdas deleted the issue-2-linters branch June 24, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants