by tadfisher · 10y ago · 0 comments
Because the mapping from one whitespace style to another is not a bijection. Moreover, our source control tools rely on things like content hashes which change when even a single bit of the source has changed, and sometimes even our language parsers depend on whitespace format.
Frustrating, I know, but you will not see a resolution to this problem with automated tools alone. You will, however, when the Tab key is removed from keyboards altogether :)
https://help.github.com/articles/dealing-with-line-endings/
It would probably have to be configured per repo so that it doesn't mess with tab delimited files etc.
Pre commit hooks, combined with an appropriate *-tidy program for your language. Code is formatted according to the repo tidy config with a pre-commit hook and formatted according to the developers preference on checkout.
I'm missing why whitespace style mapping is not a bijection, you do have to accept some limits to code style in terms of completely rigid indentation rules, and it is obviously language specific. But it seems to be a bijection to me, what am I missing?