diff --git a/.editorconfig b/.editorconfig index e69de29bb2..90abd91b3a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -0,0 +1,5 @@ +[*] +end_of_line = lf + +[*.bat] +end_of_line = crlf \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index b8e87403f1..e4d6260f89 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,52 @@ -*.bat text -*.csv text +# For each file not matching a pattern listed below, let git automatically +# detect whether it's a text file. If it is, use LF end of lines. +# Last match resolves, so we place the catch-all at the top of the file. +* text=auto eol=lf + +# Text file whose eol is not specified defaults to LF. We only need to +# explicitly specify when we want CRLF. +*.awk text +*.bat text eol=crlf *.css text +*.csv text +*.gradle text *.html text *.java text +*.js text +*.json text +*.kt text +*.kts text +*.md text +*.py text +*.sh text +*.sql text +*.toml text +*.ts text *.txt text *.xml text -.idea/dictionaries/*.xml linguist-generated=false +*.yaml text +*.yml text + +# Files we want to diff, but not change the line endings. +*.anki2 -text +*.crt -text +*.svg -text + +# Binary and compiled files. We want to neither diff nor alter these files. +*.apkg binary +*.gz binary +*.jar binary +*.mp4 binary +*.mwb binary +*.png binary +*.psd binary +*.tgz binary +*.ttf binary +*.webm binary +*.woff binary +*.xcf binary +*.zip binary + +# Tell GitHub that this file is not auto-generated, and should be displayed +# in diffs. +.idea/dictionaries/*.xml linguist-generated=false \ No newline at end of file