awjh / license-check-and-add

license-check-and-add
Apache License 2.0
11 stars 9 forks source link

[3.x regression] check always fails for files with line endings that differ from os.EOL #16

Closed dbjorge closed 5 years ago

dbjorge commented 5 years ago

In 2.3.6, the checker was agnostic to line endings (in that it split file contents by line and then rejoined them normalized them as \n before performing the license check, see index.js@v2.3.6 L173.

In 3.0.1, the checker no longer performs this normalization, so any case where os.EOL differs from files in the repository (ie, any user on windows working with autocrlf=false) will cause the checker to reject every file where the license would contain newlines.

awjh commented 5 years ago

Thanks for the heads up. #17 fixes this

awjh commented 5 years ago

Release fix - 3.0.2

dbjorge commented 5 years ago

Verified that 3.0.2 fixes our usage of the checker, thanks for the quick response!