From e30b5bd8b582b0cac8c2aef8dab8a2998a3b74cf Mon Sep 17 00:00:00 2001 From: Brad Laney Date: Thu, 7 May 2020 00:35:21 -0500 Subject: [PATCH 1/2] add gitattribute to force LF line endings and set cleanyaml.py to read/write as utf8 always --- .gitattributes | 9 +++++++++ bin/cleanyaml.py | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c4391d7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +*.yaml text eol=lf +*.py text eol=lf +*.md text eol=lf +*.sql text eol=lf +*.bat text eol=lf +*.sh text eol=lf +*.json text eol=lf +*.txt text eol=lf +*.csv text eol=lf \ No newline at end of file diff --git a/bin/cleanyaml.py b/bin/cleanyaml.py index 89925b3..01add49 100644 --- a/bin/cleanyaml.py +++ b/bin/cleanyaml.py @@ -22,7 +22,7 @@ def main(): for x in yfiles: print("Doing: {}".format(x)) - with open(x, 'r') as r: + with open(x, 'r', encoding="utf8") as r: data = yaml.full_load(r) if x == "feats.yaml": for i in data['feat']: @@ -44,7 +44,7 @@ def main(): final = yaml.safe_dump(data, allow_unicode=True) - with open(x, 'w') as f: + with open(x, 'w', encoding="utf8") as f: f.write(final) print("\tDone.") From 854d5fff8644c73e5185e5a8744685917fbaee07 Mon Sep 17 00:00:00 2001 From: Brad Laney Date: Thu, 7 May 2020 00:39:20 -0500 Subject: [PATCH 2/2] a little irony. gitattributes used CRLF --- .gitattributes | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitattributes b/.gitattributes index c4391d7..b7d649c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,9 @@ -*.yaml text eol=lf -*.py text eol=lf -*.md text eol=lf -*.sql text eol=lf -*.bat text eol=lf -*.sh text eol=lf -*.json text eol=lf -*.txt text eol=lf +*.yaml text eol=lf +*.py text eol=lf +*.md text eol=lf +*.sql text eol=lf +*.bat text eol=lf +*.sh text eol=lf +*.json text eol=lf +*.txt text eol=lf *.csv text eol=lf \ No newline at end of file