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

use_standalone() is useful outside packages #2087

Open
daranzolin opened this issue Nov 26, 2024 · 1 comment
Open

use_standalone() is useful outside packages #2087

daranzolin opened this issue Nov 26, 2024 · 1 comment
Labels
code 🖥️ R/, tests/ tidy-dev-day 🤓 Tidyverse Developer Day

Comments

@daranzolin
Copy link

I've started running usethis::use_standalone("rlib/rlang", file = "types-check") within my {targets} projects. It works great because {targets} sources the files in R/ each run. Thus, use_standalone() prints a superfluous error message:

> use_standalone("r-lib/rlang", file = "types-check")
✔ Setting active project to "<redacted>".
✔ Writing R/import-standalone-types-check.R.
✔ Writing R/import-standalone-obj-type.R.
Error: No root directory found in <redacted> or its parent directories. Root criterion: contains a file "DESCRIPTION" with contents matching "^Package: "
@jennybc
Copy link
Member

jennybc commented Jan 31, 2025

use_standlone() only explicitly checks for project-hood, but, yes, it later got some logic for adding the dependencies of the standalone file and that implicitly checks for a package.

So we should skip those actions in the absence of a DESCRIPTION file (and probably emit some messaging?).

(In the meantime, it's also perfectly valid to have a DESCRIPTION file in a non-package project, so you could experiment with placing one to give use_standalone() something to act on.)

@jennybc jennybc added code 🖥️ R/, tests/ tidy-dev-day 🤓 Tidyverse Developer Day labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code 🖥️ R/, tests/ tidy-dev-day 🤓 Tidyverse Developer Day
Projects
None yet
Development

No branches or pull requests

2 participants