REditorSupport / vscode-R

R Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=REditorSupport.r
MIT License
1.07k stars 128 forks source link

Recognize and honor .lintr file #28

Closed hafen closed 6 years ago

hafen commented 6 years ago

For folders that use a .lintr file, it would be nice is this extension would honor those settings.

Ikuyadeu commented 6 years ago

@hafen I didn't know that, and I'll try. Thank you for your good information!

hafen commented 6 years ago

👍 Thanks for looking into it and making this extension.

Ikuyadeu commented 6 years ago

@hafen , new this extension 0.5.0 supported folder's lintr by settings r.lintr.isPackages to true. However, supporting .lintr is still on TODO yet. Please change r.lintr.linter in setting.json until support. Such as

 "r.lintr.linters": "with_defaults(line_length_linter(100))"
smped commented 3 years ago

I currently have this issue on Ubuntu 18.04 using lintr 2.0.1 and R4.0.3. On a separate Windows machine with an WSL installation running Ubuntu 20.04 and R4.1.x the situation is identical.

cat ~/.vscode/extensions/ikuyadeu.r-2.0.0/R/.lintr 
linters: with_defaults(
  line_length_linter(120),
  cyclocomp_linter = NULL,
  object_name_linter = NULL,
  object_usage_linter = NULL)

I'm getting problems detected such as:

Lines should not be more than 80 characters Variable and function name style should be snake_case

Changing the values in the .lintr file makes no difference. Linting manually using lintr::lint("path/to/file") behaves as expected.

renkun-ken commented 3 years ago

@steveped You should edit ~/.lintr.