mirror of
https://github.com/Automattic/harper.git
synced 2025-08-04 18:48:02 +00:00
feat: enforce LF line endings everywhere
Contributors who work on Windows might accidentally commit newly created files with CRLF line endings, later causing noisy diffs when Linux developers work on the same files and they do not have `core.autocrlf = true`. However nowadays, most text editors work with LF line endings just fine on windows, so there's no need for this incompatibility. Add an `.editorconfig` file which causes the text editor to create new files using LF from the get-go instead of CRLF (VSCode needs https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig in order to conform). Add a `.gitattributes` file to tell git to always checkout files using LF as line ending. Normalize line endings throughout the codebase using `git add --renormalize .`. https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/ https://docs.github.com/en/get-started/git-basics/configuring-git-to-handle-line-endings
This commit is contained in:
parent
f72dcd3ef2
commit
00998a1df4
3 changed files with 49 additions and 44 deletions
4
.editorconfig
Normal file
4
.editorconfig
Normal file
|
@ -0,0 +1,4 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
* text=auto eol=lf
|
Loading…
Add table
Add a link
Reference in a new issue