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

`no_tab_linter` error in one R script, but not in others with unequal indent.

Open Fred-Wu opened this issue 3 years ago • 2 comments

I was reading someone else's codes, and in one of the scripts, a linter error appeared in the entire script and suggested not to use tab. The auto indent space is 4.

So I started to test it with the following codes in 3 files.

Simple test on one script with lots of no_tab_linter error. image

In another file without no_tab_linter error, and the auto indent space is 2. image

I also used a completely new script, and this time the auto indent space is 4 without linter error. image

This is the first time I encounter this. What could be the possible reason?

Fred-Wu avatar Apr 15 '22 14:04 Fred-Wu

Could it be a problem of the lintr package? https://github.com/r-lib/lintr#available-linters

eitsupi avatar Apr 16 '22 12:04 eitsupi

Does the last file contain tabs or 4 spaces? If it's 4 spaces, you'll probably want r-lib/lintr#497 to be merged so a new indentation_linter() allows you to control indentation style.

AshesITR avatar May 11 '22 09:05 AshesITR

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar May 12 '23 01:05 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 26 '23 01:05 github-actions[bot]