Removing wavy warnings about long lines in R-VSCode

584 Views Asked by At

I am running R in Visual Studio Code. I would like to get rid off the Lines should not be more than 80 characters.line_length_linter warnings marked as wavy underlines. I would like to get a global effect so that the warnings are removed from all R files I create wherever I want.

Could someone clarify this and this discussions a little. I already tried to put the following line:

linters: with_defaults(line_length_linter=line_length_linter(10000))

in .lintr file I created. I tried both locations R-4.2.2\library\lintr and R-4.2.2\library\lintr\R. In the later one there is the pre-existing lintr file without .. No help, I also tried:

linters: linters_with_defaults(line_length_linter=line_length_linter(10000))

and it didn't help either. I tried to relaunch the VSCode after the changes.

Edit: if I put the .lintr file with the following line into a higher-level folder of the R script I write, the warnings are gone (the lintr package is installed and is working).

linters: linters_with_defaults(line_length_linter=line_length_linter(10000))
1

There are 1 best solutions below

0
On

You can do it by creating a lintr config file at ~/.lintr with the following content:

linters: linters_with_defaults(
    line_length_linter(10000), 
  )