vechain / thor

A general purpose blockchain highly compatible with Ethereum's ecosystem
GNU Lesser General Public License v3.0
796 stars 247 forks source link

Update linter to 1.55 #761

Closed otherview closed 4 months ago

otherview commented 4 months ago

Description

This is weird one.

  1. Linter should be failing for both PR and Master. But it only fails in Master.

  2. When one emulates what github does: docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.54.2 golangci-lint run -v it fails with:

    state/state.go:515:40: G601: Implicit memory aliasing in for loop. (gosec)
        if err := saveAccount(trieCpy, addr, &c.data, &c.meta); err != nil {
                                             ^
    vm/instructions_test.go:223:2: G101: Potential hardcoded credentials (gosec)
    y := "a1f5aac137876480252e5dcac62c354ec0d42b76b0642b6181ed099849ea1d57"
    ^
    vm/instructions_test.go:243:2: G101: Potential hardcoded credentials (gosec)
    x := "4bfcd8bb2ac462735b48a17580690283980aa2d679f091c64364594df113ea37"
    ^
    vm/instructions_test.go:244:2: G101: Potential hardcoded credentials (gosec)
    y := "97f9b1765588c4e6b69142eb00d20507301545acf3e1238c86c8b29be227d46e"
  3. Unsure why this does not happen in the PR run

  4. Locally I typically run version 1.55.2 where the linter does not fail.

  5. @leszek-vechain is running version 1.57.2 where the linter does not fail.

My assessment is that something is off in the 1.54.2 version because it technically is not repeating the expected result.

This PR bumps the Linter to 1.55.2 and go to 1.22 (for the linter).

I think as part of the update golang task we should do a bump the linter to latest and upgrade all dev versions to the same version. ie. I'm running go1.22 golangci-lint but running go1.19 for thor.

Fixes # (issue)

Type of change

Checklist:

codecov-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 61.88%. Comparing base (8f2373b) to head (d195546).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #761 +/- ## ======================================= Coverage 61.88% 61.88% ======================================= Files 202 202 Lines 18696 18696 ======================================= Hits 11570 11570 Misses 6015 6015 Partials 1111 1111 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.