-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Update to lintr needed? #451
Comments
Thanks @joelnitta. The difference is probably due to the way {lintr} is called. We don't your whole source package prior to calling {lintr}, but we only lint the files staged for commit. This is arguably different from what you do when you call {lintr} interactively. Please see #440. |
@lorenzwalthert it certainly looks like you are right - I think I've encountered the same thing as #440. There's one thing I don't understand though: It looks like {precommit} calls lintr::lint(path), but when I run |
Ok. Make sure to not Rscript -e "lintr::lint(path)" With the same result? I think maybe {lintr} runs |
Ah, that does make the difference. I'm not using RStudio (I use vs-code), but if I run |
Before filing a bug
remotes::install_github('lorenzwalthert/precommit')
precommit::autoupdate()
)Describe the bug
Internal (non-exported) functions that are defined in a separate file from an exported function (e.g., functions in a
utils.R
file) trigger the lintr "[object_usage_linter] no visible global function definition
" warning. I do not encounter this behavior when running lintr myself with lintr v3.0.2. It seems {precommit} is running v3.0.1 so I suspect that may be causing the problem:precommit/renv.lock
Line 274 in 428e0f9
To Reproduce
Steps to reproduce the behavior:
utils.R
with a non-exported functionexported.R
)exported.R
Expected behavior
No warning from the lintr
Additional context
The text was updated successfully, but these errors were encountered: