vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

Support for experimental https://lintr.r-lib.org/reference/read_settings.html#details

Open raffaem opened this issue 6 months ago • 0 comments

Describe the bug

vscode-R doesn't support the experimental lintr.R configuration file.

Only the DCF .lintr file is supported

To Reproduce

Create a lintr.R file:

linters <- linters_with_defaults(
    assignment_linter(operator = c("<-", "<<-", "%<>%")), 
    return_linter(
        return_style = c("implicit", "explicit"),
        allow_implicit_else = FALSE
    ),
    pipe_consistency_linter(pipe = c("auto")),
    line_length_linter = NULL,
    commented_code_linter = NULL)
encoding <- "UTF-8"

Write a R script with a very long line.

VS Code will complain that the line exceeds 80 characters.

Open a terminal and run lintr::lint("code.R").

No lints will be found.

Rename .lintr.R into .lintr and substitute the <- with :.

Press CTRL+P and then Reload Windows.

VSCode won't complain about too long lines anymore.

Environment (please complete the following information):

  • OS: Windows
  • VSCode Version:

Version: 1.102.2 (user setup) Commit: c306e94f98122556ca081f527b466015e1bc37b0 Date: 2025-07-22T12:15:48.520Z Electron: 35.6.0 ElectronBuildId: 11847422 Chromium: 134.0.6998.205 Node.js: 22.15.1 V8: 13.4.114.21-electron.0 OS: Windows_NT x64 10.0.26100

  • R Version
> sessionInfo()
R version 4.5.0 (2025-04-11 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)

Matrix products: default
  LAPACK version 3.12.1

locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8    

time zone: Europe/Rome
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] lintr_3.2.0.9000

loaded via a namespace (and not attached):
 [1] compiler_4.5.0     backports_1.5.0    lazyeval_0.2.2     cli_3.6.5
 [5] tools_4.5.0        rex_1.2.1          parallel_4.5.0     xmlparsedata_1.0.5
 [9] glue_1.8.0         rstudioapi_0.17.1  xml2_1.3.8         jsonlite_2.0.0
[13] rlang_1.1.6    
  • vscode-R version: 2.8.6

raffaem avatar Jul 30 '25 17:07 raffaem