From c91373455b2d98daa88e29e1920de310c93d684c Mon Sep 17 00:00:00 2001 From: Greg Nazario Date: Thu, 22 Dec 2022 07:42:55 +0000 Subject: [PATCH] [git] Enforce Unix style LF endings The editorconfig file is used natively across multiple editors and will ensure that most editors don't put CRLF into the codebase. Additionally, the .gitattributes will enforce LF over CRLF on commits. --- .editorconfig | 8 ++++++++ .gitattributes | 26 +++++++++++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000..b8ec00a1c313c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +# This file adds LF and newline support at the end of files +# for many editors automatically including Github +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true diff --git a/.gitattributes b/.gitattributes index 0c7659acf9477..18c74671c784a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,19 +1,27 @@ # Ensure that text files that any contributor introduces to the repository # have their line endings normalized to LF -* text=auto +* text=auto eol=lf # All known text filetypes -*.md text -*.proto text -*.rs text -*.sh text -*.toml text -*.txt text -*.yml text +*.cfg text eol=lf +*.Dockerfile text eol=lf +*.hcl text eol=lf +*.json text eol=lf +*.md text eol=lf +*.move text eol=lf +*.proto text eol=lf +*.py text eol=lf +*.rs text eol=lf +*.sh text eol=lf +*.tf text eol=lf +*.toml text eol=lf +*.txt text eol=lf +*.yaml text eol=lf +*.yml text eol=lf # Use Move syntax highlighter for Move IR code *.mvir linguist-language=Move # Generated files, dont show diffs etc **/src/pb/*.rs linguist-generated=true -*.fixture linguist-generated=true \ No newline at end of file +*.fixture linguist-generated=true