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

Enable wastedassign linter & fix findings #13507

Merged
merged 2 commits into from Jan 25, 2024

Conversation

jtraglia
Copy link
Contributor

What type of PR is this?

Other

What does this PR do? Why is it needed?

  • Enable the wastedassign linter by removing it from the list of disabled linters.
    • As the name implies, this finds wasted assignment statements.
  • Fix the findings; there were only a few.

@jtraglia jtraglia requested a review from a team as a code owner January 23, 2024 16:45
Copy link
Member

@terencechain terencechain left a comment

Choose a reason for hiding this comment

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

I think it's important to consider that in some rare cases, assigning a value of 0 can be more readable than uninitialized. This might be the author's way of explicitly setting a value to 0 and ensuring a clear type, as opposed to declaring the variable first and deciding its value later

@jtraglia
Copy link
Contributor Author

Yeah I agree, explicitly initialized values can be more readable. But I think the limitation is worth it to enable this linter. It pointed out the issue from this PR a while back:

@rkapka rkapka enabled auto-merge January 25, 2024 16:46
@rkapka rkapka added this pull request to the merge queue Jan 25, 2024
Merged via the queue into prysmaticlabs:develop with commit 835dce5 Jan 25, 2024
17 checks passed
@jtraglia jtraglia deleted the enable-wastedassign branch January 25, 2024 18:00
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.

None yet

3 participants