Skip to content

Conversation

@mwbrooks
Copy link
Member

@mwbrooks mwbrooks commented May 2, 2025

Summary

This pull request enables the linter staticcheck rule ST1006: 'Poorly chosen receiver name'.

🧠 🧠 🧠

The name of a method’s receiver should be a reflection of its identity; often a one or two letter abbreviation of its type suffices (such as “c” or “cl” for “Client”). Don’t use generic names such as “me”, “this” or “self”, identifiers typical of object-oriented languages that place more emphasis on methods as opposed to functions.

For this PR, the only change required was to remove the _ receiver name, which was used to represent an unused variable.

Requirements

@mwbrooks mwbrooks added code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment labels May 2, 2025
@mwbrooks mwbrooks added this to the Next Release milestone May 2, 2025
@mwbrooks mwbrooks self-assigned this May 2, 2025
@mwbrooks mwbrooks requested a review from a team as a code owner May 2, 2025 18:59
@codecov
Copy link

codecov bot commented May 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.17%. Comparing base (dde98d3) to head (33852ac).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #75   +/-   ##
=======================================
  Coverage   63.17%   63.17%           
=======================================
  Files         210      210           
  Lines       22187    22187           
=======================================
  Hits        14016    14016           
  Misses       7084     7084           
  Partials     1087     1087           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mwbrooks mwbrooks modified the milestones: v3.1.0, Next Release May 2, 2025
Copy link
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

Alas so gone be the discarded value _ 🫡

Without doing a grep of all possibilities I am glad to find this rule might be generous with what's allowed. Erroring for fs would be frustrating IMO 🔍

@mwbrooks
Copy link
Member Author

mwbrooks commented May 5, 2025

Thanks for the review @zimeg! 🙇🏻 I didn't know that _ was poor practice either OR that you can skip the receiver name entirely 🧠 It feels good to have these rules in place. 🚦

@mwbrooks mwbrooks merged commit f21cbc2 into main May 5, 2025
6 checks passed
@mwbrooks mwbrooks deleted the mwbrooks-lint-st1006 branch May 5, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants