-
Notifications
You must be signed in to change notification settings - Fork 30
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
adjust update_envs
to make sure that created files have LF line endings
#455
Conversation
Codecov Report
@@ Coverage Diff @@
## main #455 +/- ##
=======================================
Coverage 93.24% 93.24%
=======================================
Files 247 247
Lines 17987 17987
=======================================
Hits 16772 16772
Misses 1215 1215 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Hi @ChristianZimpelmann, can you describe the problem you get with the mixed-line-ending hook? I thought the whole point of that hook was to fix such problems. |
The problem is that |
Ah, probably because they are not staged. I was just worried how robust this approach is. Do you have a source for this trick? Then we could just add a comment and the source to explain why we open a yaml file in binary mode. |
Good point! I found a much better solution now, but nevertheless added a comment including a source for the solution. |
Our development environment already uses Python 3.10, so we could probably also use this, right? Path('my.txt').write_text('hello\nworld', newline='\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can merge this from my side (as is or with Tim's suggestion). Thanks a lot!
Thanks, @timmens for the reference! That seems like the best solution. |
On Windows, the environment files created by
update_envs
have CRLF line endings.In particular, this leads to problems with the
mixed-line-ending
hook.This PR makes sure that LF line endings are used by opening the file in binary mode.
I am of course open for other solutions.