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

Review check in simplify_terms() #267

Closed
hfrick opened this issue Oct 22, 2024 · 2 comments
Closed

Review check in simplify_terms() #267

hfrick opened this issue Oct 22, 2024 · 2 comments
Labels
upkeep maintenance, infrastructure, and similar

Comments

@hfrick
Copy link
Member

hfrick commented Oct 22, 2024

Is this check necessary? We only call simplify_terms() on objects that have passed through model.frame() via model_frame().

hardhat/R/util.R

Lines 16 to 18 in 92ad391

if (!is_terms) {
abort("`x` must be a terms object")
}

@hfrick hfrick added the upkeep maintenance, infrastructure, and similar label Oct 22, 2024
@topepo
Copy link
Member

topepo commented Oct 23, 2024

Sure. It's only used in a closed system where we create the terms from scratch, so there is a low risk of ever occurring (and probably isn't testable).

@hfrick hfrick mentioned this issue Oct 25, 2024
@hfrick
Copy link
Member Author

hfrick commented Jan 28, 2025

If I remember correctly, this isn't the only check that uses this pattern. Being on the defensive side of programming feels in keeping with hardhat's general spirit so I'm gonna close this issue and we can open a broader one if we change our mind on the pattern.

@hfrick hfrick closed this as completed Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upkeep maintenance, infrastructure, and similar
Projects
None yet
Development

No branches or pull requests

2 participants