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

Add --load-package to lintr #615

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

agvandervelde
Copy link

@agvandervelde agvandervelde commented Feb 25, 2025

Hi @lorenzwalthert, I need to load packages prior to running lintr in CI/CD, so I can account for "spurious" global variables (e.g., when using box, dplyr, etc.) using utils::globalVariables() (see r-lib/lintr#352 (comment)). I'm currently running off of the branch on my fork but I think it'd be useful to incorporate this in your upstream. Issue #440 suggests there's a broader need for this.

@lorenzwalthert
Copy link
Owner

lorenzwalthert commented Feb 25, 2025

Hi @agvandervelde , do I understand correctly that you list all your package's dependencies in additional_dependenies, just like for the roxygenise hook? Or do you override language: r? In any case, that needs to be documented better. I'll try to do amend your PR to that effect.

@agvandervelde
Copy link
Author

agvandervelde commented Feb 25, 2025

Yes, I list the dependencies in additional_dependenies. We're doing that already for styler so it's not an additional burden in our case. Thank you for looking into this!

@lorenzwalthert
Copy link
Owner

For styler? I don’t get it. How would the styler hook need additional dependencies? You mean roxygen? This needs to load the package as per the docs.

@agvandervelde
Copy link
Author

For styler? I don’t get it. How would the styler hook need additional dependencies? You mean roxygen? This needs to load the package as per the docs.

Apologies, yes, roxygen.

lorenzwalthert and others added 4 commits March 12, 2025 09:46
- Arguments is a header and each argument doc is a bullet
- All arguments are listed in the same code block (generally)
@lorenzwalthert lorenzwalthert changed the title Add --load_package to lintr Add --load-package to lintr Mar 12, 2025
@lorenzwalthert
Copy link
Owner

Hi @agvandervelde, sorry this took a while... I pushed some (mildly related) doc changes to this branch too and I think this should be mergeable soon. Thanks for your work.

@agvandervelde
Copy link
Author

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants