lidatong / dataclasses-json

Easily serialize Data Classes to and from JSON
MIT License
1.34k stars 151 forks source link

[Guess] Looks like we have CRLF sneaked to the source code tree #461

Open USSX-Hares opened 11 months ago

USSX-Hares commented 11 months ago

Description

I was browsing the project documentation and noticed that all source code snippets have an extra newline after each normal line. This is usually caused by some software processing CRLF as two separate and independent newline symbols.

Code snippet that reproduces the issue

https://lidatong.github.io/dataclasses-json/reference/dataclasses_json/api/

image

george-zubrienko commented 11 months ago

Yeah windows users leaking the poison into the source :) Unfortunately, we can't update the line-endings only since git will ignore that, but we can add .gitattributes file that forces commits to be LF?

USSX-Hares commented 11 months ago

Yeah windows users leaking the poison into the source :) Unfortunately, we can't update the line-endings only since git will ignore that, but we can add .gitattributes file that forces commits to be LF?

Actually, committing the EoL changes only is possible, but that drastically garbages the Git history. I've done that kind of purification a few times for my own repos.

USSX-Hares commented 11 months ago

As a workaround for the documentation page, I can suggest adding core.autocrlf = input option to the GitHub Workflows checkout config.

george-zubrienko commented 11 months ago

Will send a PR later this week