-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should line ending default to LF in RStudio project files? #1002
Comments
Thoughts @jmcphers? Some context and back story:
|
There is currently no API for modifying Rproj files. I think it'd be fine to set line ending prefs by editing the file directly (especially if you're creating it yourself). |
Just to make things crystal clear: We're talking about adding a line like this to usethis's default
|
This specifically concerns usethis creating new files, right? Because RStudio will already respect the line endings of existing files. |
@hadley I think so, yes, when creating a new project. |
But the project already exists in the TDD scenario — it's that they're on windows, create a new file using (e.g.) |
Right. Looking at it now, I don't think RStudio keeps the line ending characters. More precisely, maybe with some settings it does, but e.g. if the global option is set to 'Platform native' and the project does not set any option, like in the usethis template, then when editing a file, RStudio might change the line endings for the whole while. This is not a problem if git is set up to auto-convert. But it is not set up that way, the commit will have changed line endings. I think putting
in project file (template) would solve this, irrespectively of the global Rstudio setting, OS and git conversion config. |
So there are two problems:
|
See also #767. Yet another idea: when you create a project, we set the line ending conversion to the current platform. |
Minimal implementation for discussion - I'll add docs and tests if we agree that this approach makes sense. Fixes #1002
* Update base_rate and exchange_rate by renaming with get_ prefix * reduce diffs, export functions, rerender docs and pkgdown site * use .Deprecated per https://r-pkgs.org/release.html * use template to generate docs for deprecated functions satisfy R_CMD_CHECK * make R CMD CHECK happy :( * capitalization * fix capitalization again * Undo changes to Rproj from using different platforms * Standardize line endings r-lib/usethis#1002 Co-authored-by: Philip Khor <philip10khor@gmail.com>
Should we set the line ending characters to LF in the RStudio project files? Otherwise people might end up with CRLF line endings on Windows, depending on their git settings.
The text was updated successfully, but these errors were encountered: