Open xicri opened 2 months ago
@yasuking0304 I have added the .gitattributes to automatically convert CRLF to LF on the commit.
When you have time, can you pull the latest main
, run git config --local core.autocrlf true
in the project root of genshin-langdata, restore end_of_line = lf
into your .editorconfig if you have deleted it, and check if any problems happen?
There is no problem with MacOS.
On Windows, if "end_of_line = lf" is left, newline conversion will be performed with "git config --local core.autocrlf true" enabled, and a warning will be displayed in tags.json.
And as you may have noticed, json5 files do not seem to be subject to the "end_of_line = lf" check. So, I think it would be fine to leave "end_of_line = lf" as it is, and if there is anything to add, it should be included in README.md for people who want to participate as contributors on Windows.
Thanks for checking!
Hmm... Looks like .gitattributes does not affect core.autocrlf
setting, unfortunately.
Since I can't set gitconfig value like core.autocrlf
automatically when the other developers cloned or pulled the genshin-langdata repo, I probably have to write an instruction to run git config [--local] core.autocrlf false
in the README as you mentioned.
I prefer automation and I don't like this way since it's not smart, but there seems no other better solutions...😖
And as you may have noticed, json5 files do not seem to be subject to the "end_of_line = lf" check.
The red underlines are not by EditorConfig. It only converts on file save, but does not validate like linters. I guess the red underlines are by VSCode's built-in JSON validators for *.json and by ESLint for *.js files. JSON5 is not officially supported by VSCode. I guess that's the reason why the underlines are not shown in *.json5 files.
As I said somewhere in this repo before, I'm considering to convert JSON5 files to TypeScript for better support, so it may be affect after the conversion...
@xicri TODO: write an instruction to disable core.autocrlf
on Windows.
From https://github.com/xicri/genshin-langdata/issues/189#issuecomment-2360918462
I will try to solve this issue by adding .gitattributes with
* text=auto eol=lf
.