Skip to content

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

Merged
merged 1 commit into from
Feb 1, 2020
Merged

Add editorconfig file #27

merged 1 commit into from
Feb 1, 2020

Conversation

alanz
Copy link
Collaborator

@alanz alanz commented Jan 30, 2020

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.

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.
@alanz
Copy link
Collaborator Author

alanz commented Jan 30, 2020

And we should probably add one to hie too

@jneira
Copy link
Member

jneira commented Jan 31, 2020

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.

@alanz
Copy link
Collaborator Author

alanz commented Jan 31, 2020

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.

@ndmitchell
Copy link
Collaborator

@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.

@alanz
Copy link
Collaborator Author

alanz commented Jan 31, 2020

I'd turn that setting off and demand LF everywhere.

For clarity, you are advocating that we keep the setting

end_of_line = LF

in the .editorconfig, as it is now in the PR? Or not specify it, by suggest that @jneira change his personal setup?

@ndmitchell
Copy link
Collaborator

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.

@jneira
Copy link
Member

jneira commented Jan 31, 2020

I think git for windows advise to set auto.crlf (and set it by default), or at least it did it the last time i installed it. I have it for that reason.

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 editorconfig (like ultraedit?) or know you has to dowload the plugin if it supports optionally via them like emacs, atom, eclipse, etc.

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 editorconfig (including the link) and how to use it in windows (mention the LF part including setting off auto.crlf)

But whatever, maybe it is time to change and auto.crlf can be set per project. 👍

@jneira
Copy link
Member

jneira commented Jan 31, 2020

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.
And i try to stick to windows defaults globally (console, system char encoding, line endings, etc) cause most users, specially beginners, usually use them and this way i hit the same issues earlier and i reproduce the problems reported even if we dont know the concrete cause, so investigating the bugs is easier.
@ndmitchell what is your experience about? sometimes i had a hard time trying to help windows users cause i've set in my system other defaults, objectively better.

@ndmitchell
Copy link
Collaborator

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.

@jneira jneira merged commit a8b931d into haskell:master Feb 1, 2020
pepeiborra pushed a commit that referenced this pull request Dec 27, 2020
Code action for type wildcards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants