-
-
Notifications
You must be signed in to change notification settings - Fork 392
Add editorconfig file #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The most important setting is to trim trailing whitespace, and use spaces not tabs on the file system. The rest can be argued. Indent size is taken from a (tiny) sammple of the existing ghcide code base.
And we should probably add one to hie too |
mmm, about line endings, i am using the git option to automatically convert LF -> CR+LF in checkout and the other way around on push, it is the recommended one by git cause win editors usually transform them auto without warn. |
We can leave line endings out of the file, it has not bitten us in the past. The thing I care about the most is trailing whitespace, to be honest. I have my editor set up to highlight it red, so it gets quite distracting, and should not be there. |
@jneira As a long time Windows user, I appreciate that's the advice, but I've always considered it terrible advice. No decent editor in the last 15 years has auto converted to CRLF - they all get it right. Even Notepad now gets it right. But the auto crlf detection does occasionally corrupt images or binaries, and makes hashes different, file sizes etc. I'd turn that setting off and demand LF everywhere. |
For clarity, you are advocating that we keep the setting
in the |
I'd encourage @jneira to change his personal setup, because the alternative works better. If he agrees, I'd keep the setting, but if not, probably not - the benefit is tiny, and slightly damaging one contributors setup isn't worth it. |
I think I actually had problems without it (not remember the tool right now) but maybe they are gone now. Otoh, if you creates a new file in windows it has cr/lf by default in almost all editors. So you will need to change that option in all editors that do not have support for I already know it but maybe a new windows contributor can be bitten by that. So maybe it would be great add a note somewhere in docs about But whatever, maybe it is time to change and |
Another thought about: to avoid copy files created in other projects where LF is not promoted (or the other way around) the best option would be adopt it everywhere. |
I am a very typical windows user - I haven't changed many defaults. I think crlf is a choice you make in the git installer. The "mangle all files on checkout" option is the only one I don't follow defaults. |
Code action for type wildcards
The most important setting is to trim trailing whitespace, and use spaces not
tabs on the file system.
The rest can be argued. Indent size is taken from a (tiny) sample of the
existing ghcide code base.