I am using emacs and lsp-mode. To edit .R files, I use rlanguageserver.
This works fine. However, I would like to disable some rules. For example, I do want to decide on my variable name format, i.e. disable the "variable name should be snake_case" message.
I placed a .lintr
file in my home directory, with this content:
linters: with_defaults(snake_case_linter = NULL)
but is has no effect. Why?
Also, when I re-indent a region, I would like to just re-indent without adding or removing line breaks, i.e. I'd like to chose the line breaks manually. How can I achieve this?
After much trial and error, it now works with the following .lintr file in my home directory:
linters: linters_with_defaults(
object_name_linter = NULL,
commented_code_linter = NULL
)
In addition, I also needed to set the path to this file in .Rprofile
. I do this with a .Rprofile
file that I have in my home directory (removing irrelevant parts):
options(lintr.linter_file = "/home/me/.lintr")