-
Notifications
You must be signed in to change notification settings - Fork 17
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
CRLF is still used as EOL in Windows #293
Comments
I'm not following here. Saved |
@josephwright I think the problem depends on how you configure your source control. if git checks out local files with windows line endings you want to save tlg with windows endings but if you configure git to not convert then you want to write the same (nix) format on all platforms otherwise files saved on windows have crnl in the repo and fail on the CI |
@davidcarlisle But isn't that the same as any other method where you've decided not to follow the system setting: managing line endings is down to you? I'm not sure how |
@josephwright not sure either is "non standard" git (like svn and cvs before it) have a boolean option to translate or not line ends. Certainly here we configure source control not to change line endings (which really messes things up if you have a shared file system) l3build would know if it had a boolean option settable in build.lua |
I meant 'non-standard' as in 'not what the system plain text editor would do' (so Notepad on Windows, TextEdit on macOS, various possibles for Linux). My worry with a control variable is it suggests the behaviour depends on the module development code, whereas it depends on the practice of the person working on the code. So it's really 'machine-dependent'. |
correct me if I'm wrong, but assuming there would be a control variable |
@josephwright well yes it's come up before that some settings might want to be personal and set from lua outside the repo (upload emails etc) But an option that is not always right seems better than a fixed setting that's always wrong (on windows with core.autocrlf off) a build.lua for a project with users with different settings could set the option after testing Currently if the checked in files have |
Well if the general feeling is it makes sense, I will of course sort it. I guess do a last-minute replacement of |
Hmm I kinda changed my idea. It seems by convention either inherited or system default EOLs are used by programs generating files that would be tracked by a version control software, and setting I consulted two front-end tools, `babel` and `npm`.
In the sense of inheritance, |
Supporting info: Code formatter prettier has an option |
Looking back, I think handling this with some 'local config' makes sense, but I wonder how we make sure such a file can only be used for appropriate variables, e.g. yes for line ending but no for anything repo-dependent. |
Currently when run in Windows,
l3build save
still uses CRLF as end-of-line in generated.tlg
, despite the existing EOL normalizations inrewrite()
(line 95 below)l3build/l3build-check.lua
Lines 93 to 102 in 2c9e178
This brings inconvenience to the cooperation between Win and non-Win users, see for example lvjr/tabularray#385 (comment).
I did some tests in muzimuzhi/hello-github-actions#6 and found
io.write()
that converts\n
to\r\n
automatically in Windows andopen(source, "rb")
) does the trick.The text was updated successfully, but these errors were encountered: