0

object_name_linter and object_length_linter are both applying to any string literal and not just object names. I didn't expect it to apply to all strings (including file names, labels, or messages printed out). Am I missing something, or should I just not use those rules if I don't want excessive warnings?

For example, this triggers object_name_linter, but I don't understand how it should be considered an object name. Can lintr not distinguish between object names and string literals?

print("Here's a message.")

I've looked through lintr docs (at the specific rules and searched for "string") and SO/web, but cannot find an answer.

  • Could you specify your setup in more detail? When I save `print("Here's a message.")` in a file called `test.R` and then in R do `library(lintr)` and `lint("test.R")` then I don't get any messages from lintr. – Marijn May 17 '23 at 19:15
  • @Marijn other than the .lintr file I use to turn off those rules, I don't have any other setup. It might have been something with VS Code, but it triggers both through VS Code and when I use lintr in an R terminal. Where else could lintr be getting set up instructions from? – William Denny May 17 '23 at 20:57

0 Answers0