-
Notifications
You must be signed in to change notification settings - Fork 186
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
Handle unused variable with glue
#352
Comments
Reprex:
|
Similar to the |
The object usage linter now respects variables declared in |
I'm not quite sure why, but declaring global variables with I think the way the check has been implemented in Maybe useful to mention I am using the latest dev version of |
You need to install the package before linting it. |
The package should be installed before running `lintr::ling_package()` or `lintr::expect_lint_free()` (our case), otherwise we could encounter some false positives. See r-lib/lintr#352 (comment) and r-lib/lintr#406 (comment) Authored-by: Dragoș Moldovan-Grünfeld <dragos.mold@gmail.com> Signed-off-by: Jonathan Keane <jkeane@gmail.com>
The following code gives a warning when
lint
is applied:The warning is
local variable 'x' assigned but may not be used
.It appears the linter
object_usage_linter
refers tocodetools::checkUsage
, which is not available on github unfortunately (so I can't open an issue). I was wondering if this issue could be handle bylintr
directly or if a workaround exists.For now, I applied a
#nolint (unused variable)
for each problematic line.The text was updated successfully, but these errors were encountered: