Good work finding the relevant issue report! There was a bug
where the IDE would produce inconsistent line endings. The chosen solution
was to make them consistent, but fixed according to your OS. Even though I use Windows, I also prefer to use Unix style line endings in all my files. I think the solution proposed by matthijskooijman would be ideal. I think the Arduino developers would be receptive to a patch contributed from the community for this change. Otherwise we can wait and hope they get to it eventually. Unfortunately, I don't think it will be a high priority for them since the current behavior is an improvement over the previous behavior and can't be considered a bug. For now, I just have my Git settings so that all files are committed to my repositories with Unix style line endings. So, even though the sketches on my computer aren't formatted as I prefer, at least I don't subject the rest of the world to Windows style line endings.