Skip to content

lint: fix inconsistent callback function parameter names#730

Merged
samber merged 8 commits intosamber:masterfrom
NathanBaulch:callbacknames
Nov 6, 2025
Merged

lint: fix inconsistent callback function parameter names#730
samber merged 8 commits intosamber:masterfrom
NathanBaulch:callbacknames

Conversation

@NathanBaulch
Copy link
Contributor

@NathanBaulch NathanBaulch commented Nov 6, 2025

Quite a few callback function parameters are incorrectly named. This PR attempts to fix a few of these. This is something I noticed whilst building the it subpackage.

There are always exceptions but...

  • if a callback returns a single bool then it should probably be called "predicate".
  • if a callback is used to change a collection element into something else then it should probably be called "transform".
  • if a callback returns nothing (void) then it should probably be called "callback".
  • Bonus: replace "cb" with "callback" for consistency.

Also, I've never seen the word "iteratee" used anywhere else before (as a native English speaker). I would propose renaming them all to something more meaningful.

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.18%. Comparing base (48d8fe4) to head (e49520b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #730      +/-   ##
==========================================
- Coverage   94.22%   94.18%   -0.04%     
==========================================
  Files          18       18              
  Lines        2805     2805              
==========================================
- Hits         2643     2642       -1     
- Misses        148      149       +1     
  Partials       14       14              
Flag Coverage Δ
unittests 94.18% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@samber
Copy link
Owner

samber commented Nov 6, 2025

I also added: #738

@samber samber merged commit e7386d9 into samber:master Nov 6, 2025
11 of 12 checks passed
@NathanBaulch NathanBaulch deleted the callbacknames branch November 6, 2025 20:13
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.

3 participants