ropensci-review-tools / pkgcheck

Check whether a package is ready for submission to rOpenSci's peer-review system
https://docs.ropensci.org/pkgcheck/
18 stars 6 forks source link

Check that fns are pipe-compatible #203

Open mpadge opened 4 months ago

mpadge commented 4 months ago

Idea from @PietrH via internal https://ropensci.slack.com/archives/C05C3GP1CSU/p1719994234029299, to check that

That functions that return objects of the same class as their input, have this input argument in the first position (for pipe compatability)

Or even to ensure that functions return consistent output, also as per tidyverse style guide. Implementing directly would, however, be arguably proscriptive. There may indeed be valid cases for alternative API designs, so this would need to be carefully thought out. Implementation would nevertheless be relatively straighjtforward, and would only require additional typetracer dependency here. @PietrH also happy to further discuss ideas, approaches, and viability here. Thanks for the input!