R-CMD-check fails on Windows due to a carriage return being added at the end of strings.
actual vs expected
171
- "X Y[{height=20px style='margin: 0 4px; vertical-align: baseline'}](https://orcid.org/0000-0000-0000-0000)\r"
172
+ "X Y[{height=20px style='margin: 0 4px; vertical-align: baseline'}](https://orcid.org/0000-0000-0000-0000)"
What's the recommended strategy to handle this?
I've found some mention of .gitattributes
that might help here, but before diving more into this, I'd like to have some opinion from people with experience about this problem.
Edit:
It seems like I might also be able to control that with git config --global core.autocrlf
. If so, would that be favored over using .gitattributes
when not working in a team?
Possibly related, I have the following helper in my package to control how to rebuild the YAML header of .Rmd
/.qmd
files. Would using .gitattributes
or git config also controls that for me automatically?
line_break <- function() {
if (.Platform$OS.type == "unix") "\n" else "\r\n"
}