It seems that the 'Tidyverse Style Diagnostic' written by Hadley Wickham is inconsistent with the 'R Style Diagnostics' in RStudio.
R Studio flags white spaces in {{ x }} as unnecessary whitespaces:
while the style guide explicitly suggests to use whitespaces when embracing with {{:
Since Wickham is Chief Scientist at RStudio I would think he would want the two to be consistent. Is there any good place to point this out to the folks at RStudio?
This is definitely a strange edge case I presume. I'm looking at this code piece:
# good and bad
ggplot(data) +
scale_fill_viridis_c(begin = 0,
alpha = 0.5,
direction = -1,
na.value = "gray",
trans = "log",
breaks = {{ legend_breaks }},
labels = {{ legend_labels }} )
In my original script (Rmd) it gets flagged as unnecessary whitespace so I copied this part to a new script and it didn't get flagged. However, once I saved the file and when back to the source window it was flagged: