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

How to create your own check_ function #160

Open
hadley opened this issue Aug 2, 2023 · 3 comments
Open

How to create your own check_ function #160

hadley opened this issue Aug 2, 2023 · 3 comments

Comments

@hadley
Copy link
Member

hadley commented Aug 2, 2023

No description provided.

@hadley hadley changed the title How to create a check_ function How to create your own check_ function Aug 2, 2023
@jonthegeek
Copy link

I'd like to understand why these shouldn't be gathered in a checker package (or in rlang, since it already holds the standalone files that are needed for these, and you need to import rlang to use those files). I accept that there's probably a reason that you do the use_standalone("r-lib/rlang", file = "types-check") thing, but I don't grok it. Is it cleaner for those to exist inside the package namespace?

@hadley
Copy link
Member Author

hadley commented Aug 3, 2023

The standalone file is just a workaround until we create that package. It's just not obvious how that package should work since ideally rlang would use that package, but that package would be easier to implement if it could use rlang function, creating a circular dependency. One day we'll figure out how to resolve that and make a checker package. (Or we'll just accept that we should export them from rlang).

We also didn't want to get locked into an API too early for something this important, but I think we're now pretty happy with how these functions so that's no longer a consideration.

@jonthegeek
Copy link

The standalone file is just a workaround until we create that package. It's just not obvious how that package should work since ideally rlang would use that package, but that package would be easier to implement if it could use rlang function, creating a circular dependency. One day we'll figure out how to resolve that and make a checker package. (Or we'll just accept that we should export them from rlang).

We also didn't want to get locked into an API too early for something this important, but I think we're now pretty happy with how these functions so that's no longer a consideration.

Aha, that makes sense! I thought there was something that I wasn't understanding about why it wouldn't work.

I'm working on my own version of that package right now (with some other opinions that might make it not-quite-what-you'd-want)... but it imports both vctrs and rlang, so, yeah, it wouldn't work in those.

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

No branches or pull requests

2 participants