diff options
author | Vladimir Glavnyy <31897320+vglavnyy@users.noreply.github.com> | 2019-03-19 02:47:07 +0700 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2019-03-18 12:47:07 -0700 |
commit | f93d0f6ac1ccf57727e95421c1dc154351458c4c (patch) | |
tree | 43c1221281687ebd5ab9f922801d2b91f0efbdd1 /.travis | |
parent | fd51fadaac768b166c4cd356eff72fe766bfbb46 (diff) | |
download | flatbuffers-f93d0f6ac1ccf57727e95421c1dc154351458c4c.tar.gz flatbuffers-f93d0f6ac1ccf57727e95421c1dc154351458c4c.tar.bz2 flatbuffers-f93d0f6ac1ccf57727e95421c1dc154351458c4c.zip |
Unify line ending rules in '.editorconfig' and '.gitattributes' (#5231)
* Unify line ending rules in '.editorconfig' and '.gitattributes'
* Revert '.gitattributes'
- fix invalid comments in the check-source.py
Diffstat (limited to '.travis')
-rw-r--r-- | .travis/check-sources.sh.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/.travis/check-sources.sh.py b/.travis/check-sources.sh.py index 5ad060cd..2b001d76 100644 --- a/.travis/check-sources.sh.py +++ b/.travis/check-sources.sh.py @@ -18,12 +18,11 @@ def check_encoding(encoding, scan_dir, regex_pattern): btext.decode(encoding=encoding, errors="strict") if encoding == "utf-8" and btext.startswith(b'\xEF\xBB\xBF'): raise ValueError("unexpected BOM in file") - # check strict CRLF line-ending - LF = btext.count(b'\r') - CRLF = btext.count(b'\r\n') - assert LF >= CRLF, "CRLF logic error" - if CRLF != LF: - raise ValueError("CRLF violation: found {} LF characters".format(LF - CRLF)) + # check LF line endings + LF = btext.count(b'\n') + CR = btext.count(b'\r') + if CR!=0: + raise ValueError("invalid line endings: LF({})/CR({})".format(LF, CR)) except Exception as err: print("ERROR with [{}]: {}".format(fname, err)) return -1 |