Skip to content

Conversation

@ldez
Copy link
Contributor

@ldez ldez commented Apr 9, 2025

This PR needs PR #1307.

The problem of consistency was related to a missing call to Package.TypeCheck().

The UnexportedReturnRule calls Package.TypeOf(), but this requires the data from Package.TypeCheck(): depending on the order of the rule, the data may exist or may not.

I checked the calls to Package.TypeOf(), and it is only missing for unexported-return.

The bad news is that unexported-return is now a part of the other issue about Package.TypeCheck().
Concretely, it was already a part of this issue as it relies on Package.TypeOf().

The regression comes from #1170 (v1.6.0); this explains why the number of issues has increased since the beginning of the year.

Note: I also fixed a problem with a missing call to types.Unalias().

Fixes #1306

Note: numbers have changed (723 -> 722) because I replaced wc with jq (so no extra empty line).

$ ./revive-bench.sh
722
722
722
722
...
722
722
722
revive-bench.sh
#!/bin/bash -e

for a in {1..1000}; do
    revive -formatter json ./... | jq '. |length'
done

@ldez ldez changed the title fix: add missing TypeCheck call fix(unexported-return): add missing TypeCheck call Apr 10, 2025
@chavacava chavacava merged commit 57ed899 into mgechev:master Apr 10, 2025
112 checks passed
@ccoVeille
Copy link
Contributor

Thank you so much for the investigation, time spent on it, and multiple fixes you provided

@ldez ldez deleted the fix/missing-typecheck branch April 10, 2025 10:19
@ldez
Copy link
Contributor Author

ldez commented Apr 11, 2025

@chavacava @denisvmedia, sorry to ask that, but do you plan to create a release soon?

Before updating golangci-lint with a pseudo version to revive, I prefer to check with you.

I need to create a release quickly to fix a bug with the vscode integration.

@chavacava
Copy link
Collaborator

@ldez My plan was to release this we but I can do it right now if it can help you.

@ldez
Copy link
Contributor Author

ldez commented Apr 11, 2025

ok, so I will use a pseudo-version. Thank you for the answer.

@ldez
Copy link
Contributor Author

ldez commented Apr 11, 2025

Thank you for the release.

I didn't want to force a version to be created, so thank you again ❤️

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.

Some reports are "randomly" missing

3 participants