guzba / zippy

Pure Nim implementation of deflate, zlib, gzip and zip.
MIT License
246 stars 29 forks source link

prevent automatic git EOL conversion on Windows for test files #21

Closed jangko closed 3 years ago

jangko commented 3 years ago

thanks for this excellent library.

I'm a Windows user. When I clone your repo without any special treatment an then run the test using nim c -r tests/test, it will fail when comparing decompression result of rfctest2.gold.

IIRC this can be solved using .gitattributes file to prevent specific files undergo automatic EOL conversion. In also see in your CI matrix, there is no windows build. That's why you are not aware of this subtle difference related to git.

guzba commented 3 years ago

I do my development on Windows so I sort of assumed I would personally catch issues like this. It appears I have a setting in git avoiding this problem. I agree fixing it will be very good.

guzba commented 3 years ago

I see you may be working on some CI related changes. If you do have a PR ready in the future I look forward to talking a look and getting the upgrades merged.

jangko commented 3 years ago

we use our own specific CI setup in https://github.com/status-im to make sure we don't have any surprises when integrating your library with the rest of our codebase. and it might be not suitable for your need/vision.

as for the noises in PR section, I'm sorry, that was an accident because github don't have setting to change default PR target.

guzba commented 3 years ago

Ah, no problem at all, thanks for clarifying. I'll just keep this issue focused on the line endings issue then. I have a tab for .gitattribues to read. My only concern right now is if it makes the files treated as binary it may break git diffing since binary file diffs are different iirc, but I doubt that matters for test data that doesn't change. Just doing my research.

guzba commented 3 years ago

Thanks again for reporting this issue. I have included a fix for this and verified it with windows-latest GitHub Actions. Commit is https://github.com/guzba/zippy/commit/c652834f58c0e22df78bd85870df9b60a65178f3