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

Renv dependencies.R file linter #553

Open
radbasa opened this issue Jan 29, 2024 · 2 comments
Open

Renv dependencies.R file linter #553

radbasa opened this issue Jan 29, 2024 · 2 comments

Comments

@radbasa
Copy link
Contributor

radbasa commented Jan 29, 2024

Because renv does not see packages declared in box::use(), we use a dependencies.R file for renv to parse.

Does it make sense to check if the packages are sorted alphabetically in dependencies.R?

Will an alphabetical order cause issues?

@kamilzyla
Copy link
Collaborator

Note: I think renv now parses box::use() statements. But we might still prefer a solution with dependencies explicitly listed in a single file in project root. That's how some other major languages approach it (e.g. Python, JavaScript on Node.js) - probably because it makes sense to have this important information in a single place, and because scanning the whole repository each time this information is needed can be prohibitively slow. Anyway, it would be good to revisit our approach with dependencies.R - perhaps a better solution is possible today?

If we were to stick to dependencies.R, I think a linter to check for alphabetical order could be nice, but I do see one potential problem: users might choose to use comments and group packages in some meaningful way; alphabetical sorting would break it. I'm not sure if anybody does that though.

@radbasa
Copy link
Contributor Author

radbasa commented Feb 7, 2024

Comments won't be a problem with lintr. But, grouping packages in some meaningful way does make sense (if anyone does that) and will be seen as lint if we choose to enforce alphabetically sorted library calls.

@radbasa radbasa changed the title Renv dependecies.R file linter Renv dependencies.R file linter Feb 7, 2024
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