mgechev / revive

🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
https://revive.run
MIT License
4.81k stars 281 forks source link

Test failure on version 1.3.1 with go v1.20.2 #807

Closed icp1994 closed 1 year ago

icp1994 commented 1 year ago

Describe the bug Same as title. I see that the latest version of Go that CI runs for the tests is 1.19.6 so maybe this is to be expected.

To Reproduce

$ git clone --depth=1 https://github.com/mgechev/revive
$ cd revive/
$ go test -race ./...

Expected behavior Tests pass

Output

?       github.com/mgechev/revive   [no test files]
?       github.com/mgechev/revive/cli   [no test files]
?       github.com/mgechev/revive/formatter [no test files]
?       github.com/mgechev/revive/lint  [no test files]
?       github.com/mgechev/revive/internal/typeparams   [no test files]
?       github.com/mgechev/revive/logging   [no test files]
ok      github.com/mgechev/revive/config    0.023s
?       github.com/mgechev/revive/rule  [no test files]
--- FAIL: TestReviveLint (0.00s)
    core_test.go:33: Expected failures to have 3 failures, but it has 5.
--- FAIL: TestReviveFormat (0.01s)
    core_test.go:66: Expected formatted failures '../testdata/if-return.go
          (15, 2)  https://revive.run/r#if-return         redundant if ...; err != nil check, just return error instead.  
          (88, 3)  https://revive.run/r#if-return         redundant if ...; err != nil check, just return error instead.  
          (95, 3)  https://revive.run/r#if-return         redundant if ...; err != nil check, just return error instead.  
          (91, 3)  https://revive.run/r#unreachable-code  unreachable code after this statement                           
          (98, 3)  https://revive.run/r#unreachable-code  unreachable code after this statement                           

         ✖ 5 problems (0 errors) (5 warnings)' to contain '(15, 2)  https://revive.run/r#if-return  redundant if ...; err != nil check, just return error instead.', but it didn't.
FAIL
FAIL    github.com/mgechev/revive/revivelib 0.019s
ok      github.com/mgechev/revive/test  1.200s
FAIL

Desktop (please complete the following information):

dtest commented 1 year ago

Looks to be because of this PR #799

Are there no automated tests for PRs?

mgechev commented 1 year ago

Seems to be working fine with Go 1.20.4. Are you still facing this issue?

icp1994 commented 1 year ago

It passes following https://github.com/mgechev/revive/commit/dc6909b49ff16af43ac29ce1e61265be33a3bf28 so the issue is resolved.