Force LF line endings for Windows#12266
Conversation
|
Long time no see Johann! 🎉 |
| setup_docker_prereqs eol=lf | ||
| /virtualization/Docker/scripts/* eol=lf No newline at end of file | ||
| # Ensure "git config --global core.autocrlf input" before you clone | ||
| setup_docker_prereqs text eol=lf |
There was a problem hiding this comment.
Shouldn't we just force this for all files instead of pick and choose?
There was a problem hiding this comment.
It is indeedwhat github recommends, but then you should EXCLUDE all binary files
Grepping through our repo, it seems that this should work
* text eol=lf
*.py whitespace=error
*.ico binary
*.jpg binary
*.png binary
*.zip binary
There was a problem hiding this comment.
do we even have ico, jpg, png or zip files in our repo?
There was a problem hiding this comment.
Indeed
Docs/source/static: favicon & png
Tests/resources: zip
Components/camera: jpg
There was a problem hiding this comment.
Let's follow the GitHub recommendations including * text=auto
There was a problem hiding this comment.
No, it must be * text eol=lf according to git-scm
It controls different parts:
*: Applied to all files, hence the need to remove it on binary files, like images&zip latertext: Ensure LF in the repoeol=lf: Attribute to ensure LF in the working directory (This should fix Windows)
There was a problem hiding this comment.
So confusing. Okay, so I guess this PR is fine then?
There was a problem hiding this comment.
Just pushed the version at the top of our discussion, so read to go now
There was a problem hiding this comment.
Indeed confusing, hopefully we can change it once and just forget about it again.... it only really troubles Windows users
| setup_docker_prereqs text eol=lf | ||
| /virtualization/Docker/scripts/* text eol=lf | ||
| /script/* text eol=lf | ||
| *.sh text eol=lf |
There was a problem hiding this comment.
There are no shell or Python scripts in the root? or does this also match **/*.sh ?
There was a problem hiding this comment.
*.py matches all **/*.sh:
λ git check-attr --all homeassistant\scripts\db_migrator.py
"homeassistant\\scripts\\db_migrator.py": text: set
"homeassistant\\scripts\\db_migrator.py": eol: lf
"homeassistant\\scripts\\db_migrator.py": whitespace: error
|
Quite a long time yes... my son started crawling, walking & climbing things so he takes up a lot more of my free time 😄 |
|
Okay so we missed mp3 for |
Description:
Closer to a working Docker dev environment on Windows... Ensure no CRLFs in the scripts & force LF on most files
Related issue (if applicable): fixes #
Checklist:
If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass