You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fails linting because the linter expects the value of x to be a character string. Because linting does static code analysis, it cannot and does not process or execute the paste() command to build the character string.
The other way you presented won't trigger a linting error, but it may cause linting errors further down your code. box_usage_linter() may complain about:
x<-path_some_file
As path_some_file was not defined previously. A different way to accomplish this might be to do the following:
file_paths<-list()
assign(
x=file_paths[[tolower(basename(file))]],
value=file,
envir=.GlobalEnv
)
# This should be okfoo<-file_paths$some_filename
This fails linting because the linter expects the value of x to be a character string. Because linting does static code analysis, it cannot and does not process or execute the paste() command to build the character string.
Is it possible for the linter to know that the output of paste() and paste0() is of class character? This way no code needs to be executed and the type requirement for the x arg in assign() is satisfied.
box.linters version
0.10.5
Sample source code to lint
Lint command used
Lint result
Expected result
No error expected
The text was updated successfully, but these errors were encountered: