-
Notifications
You must be signed in to change notification settings - Fork 80
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
Using 'assertive' introduces unnecessary dependencies #149
Comments
@echasnovski Feel free to create a PR to write the checks at every place the |
We wrote many of the check functions on our own as you can see by scanning through the code. Some of them were a bit overkill though so we went to using |
If writing own check functions is a way to go then I have a suggestion to use I will write a PR with this approach to replace all Does it sound good? If not, then I'll just write code without |
Using {glue} in a PR sounds great. It was on my to-do list to do so throughout the package after seeing Jim Hester’s talk at useR about it. |
Stop using package {assertive} in favor of custom type checks (#149)
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
Recently I installed
infer
for the first time and noticed that this also got 16 (sixteen!) otherassertive.*
packages installed. Those now occupy most of the 'Packages' tab when I open it. This is (weirdly) somewhat annoying as I have to do extra scrolling to get to the package I need.After studying internal code I saw that
assertive
is only used for checking types of input arguments. In other words, it is not crucial for the package logic but rather a convenient implementation choice. I can offer to change this implementation to one of the following:Use
assertive.types
package directly. This reduces number ofassertive.*
packages to 2 and is enough for current code. However, other assertion types may introduce the need for otherassertive.*
packages.Use some other (more generic) package for type checks. I can recommend checkmate for this. This reduces number of extra packages to constant 2 (
checkmate
and its dependencybackports
). It is also flexible, easy to use and extend, and has built-in functions for all current type checks (right now no extending is needed). Error messages are very similar toassertive
: both provide present and needed types:Write own assertion functions. For the current code not much work is needed to implement this. The distinctive advantage of this approach is the ability to customize error messages: for example, remove those "Error ..." in the beginning. No extra packages are needed for this option (
rlang
should be enough).I am wondering the following:
The text was updated successfully, but these errors were encountered: