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 #2943

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft

Org-wide linter #2943

wants to merge 18 commits into from

Commits on Sep 19, 2024

  1. workflows: reuse org-wide linter workflow

    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    b4f8062 View commit details
    Browse the repository at this point in the history
  2. *: fix errorlint lint errors

    Error: `Non-wrapping format verb for fmt.Errorf. Use `%w` to format errors`
    and `comparing with != || == will fail on wrapped errors. Use errors.Is to
    check for a specific error`.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    6a4d903 View commit details
    Browse the repository at this point in the history
  3. *: fix errcheck lint errors

    Error: `Error return value is not checked`.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    b87f9dd View commit details
    Browse the repository at this point in the history
  4. *: fix intrange lint errors

    Error: `for loop can be changed to use an integer range (Go 1.22+)`.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    297e544 View commit details
    Browse the repository at this point in the history
  5. *: fix whitespace lint errors

    Errors: `unnecessary leading newline` and `unnecessary trailing newline`.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    0ddfb96 View commit details
    Browse the repository at this point in the history
  6. *: fix unused and ineffassign lint errors

    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    d98abd2 View commit details
    Browse the repository at this point in the history
  7. *: fix staticcheck lint error

    Error: `SA4004: the surrounding loop is unconditionally terminated`.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    7eec572 View commit details
    Browse the repository at this point in the history
  8. *: suspend contextcheck lint error

    Error in `cmd/neofs-node/config.go`: `Function
    `Reload->Init->init->listenEvents` should pass the context
    parameter`.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    660d542 View commit details
    Browse the repository at this point in the history
  9. *: fix godot lint error

    Error: `Comment should end in a period`.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    4f4cbb1 View commit details
    Browse the repository at this point in the history
  10. *: fix misspell lint error

    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    939bb4a View commit details
    Browse the repository at this point in the history
  11. *: fix revive lint error

    Error: `duplicated-imports`.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    656adb5 View commit details
    Browse the repository at this point in the history
  12. *: fix gosimple lint errors

    Errors: `S1023: redundant `return` statement` and `S1019: should use
    make(chan *Move) instead`.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    02aed6f View commit details
    Browse the repository at this point in the history
  13. *: fix deprecated code

    Use:
    - `eacl.Target.RawSubjects` instead of `eacl.Target.BinaryKeys`
    - `eacl.NewTargetByRole` with `eacl.Target.SetRawSubjects` for targets with
    public keys
    - `eacl.ConstructTable` instead of `eacl.NewTable`
    - `eacl.ConstructRecord` instead of `eacl.NewRecord`
    - `object.Object.GetID` instead of `object.Object.ID`
    - `object.Object.GetContainerID` instead of `object.Object.ContainerID`
    - comparing with == instead of `ID.Equals`
    - `cid.NewFromMarshalledContainer(cnr.Marshal())` instead of `cid.ID
    .CalculateID`
    - `user.NewFromECDSAPublicKey` instead of `user.ResolveFromECDSAPublicKey`
    - direct copy instead of `ID.Encode`
    - direct assign instead of `ID.SetSHA256`
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    e003a68 View commit details
    Browse the repository at this point in the history
  14. *: fix govet lint error

    Error: `struct literal uses unkeyed fields`.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    b948d79 View commit details
    Browse the repository at this point in the history
  15. *: fix Receiver names are different lint error

    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    5daae82 View commit details
    Browse the repository at this point in the history
  16. *: update math/rand to v2

    Update to `math/rand/v2` and use `crypto/rand` for `rand.Read`.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    428dfe1 View commit details
    Browse the repository at this point in the history
  17. *: fix nil error checking

    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    d411599 View commit details
    Browse the repository at this point in the history
  18. *: fix Variable collides with imported package name lint error

    Closes #2940.
    
    Signed-off-by: Andrey Butusov <[email protected]>
    End-rey committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    7468c36 View commit details
    Browse the repository at this point in the history