Skip to content

Conversation

@agvandervelde
Copy link
Contributor

@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
Contributor 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
Contributor 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 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
Contributor Author

Thank you!

agvandervelde and others added 5 commits March 26, 2025 11:52
- Arguments is a header and each argument doc is a bullet
- All arguments are listed in the same code block (generally)
@agvandervelde
Copy link
Contributor Author

Rebased this PR onto current main.

@lorenzwalthert
Copy link
Owner

Sorry did not get to merge this yet. Hope everything passes now.

@lorenzwalthert lorenzwalthert merged commit 328f1ed into lorenzwalthert:main Mar 29, 2025
14 checks passed
@lorenzwalthert
Copy link
Owner

lorenzwalthert commented Mar 29, 2025

@agvandervelde thanks again. If you don’t want to wait till the next tag bump, you can also pre-commit autoupdate --bleeding-edge or similar to use the lastest main commit.

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