frc-frecon/frecon

Using EditorConfig

Opened this issue · 8 comments

While this isn't necessarily relevant to FReCon itself, one of the things I've noticed when working on Webca is that having people use different spacing settings in their editors can sometimes cause nasty merge conflicts and also messes up git diffs. I think we should use this editor plugin called EditorConfig (http://editorconfig.org/) to take cover of these spacing issues and formally specify how we want our spacing to look in both FReCon and Webca. All you have to do is create a file called ".editorconfig" in the root of your project and specify your spacing options. Installing it on most editors takes a matter of seconds. This isn't the most important issue right now, but I think it'll make collaborating easier.

rye commented

The precedent thus far has been to use "Smart Tabs," which is a scheme that semantically uses tabs for indentation and spaces for alignment per their original intent of use. @Sammidysam and I both use this scheme in our editors (we both use Emacs). I am aware that a Vim plugin exists for this, but it's not very nice, and, in my experience, it's sucked all of the times I've tried to use it.

You're welcome to drop it in, but beware that I, at least, am likely not going to disable Smart Tabs since Smart Tabs seems to be better than hard and soft tabs both. I think it's important to leave configuration of tab sizes up to users, but both hard and soft tabs limit this configurability to whatever someone decides.

I agree that continuity will make collaboration easier. If you would like to add .editorconfig to these projects for this, that's all good with me. For the FReCon API, feel free to add it and open a pull request. Just beware that it's possible that it will be disobeyed.

I'm fine with installing an Emacs package and letting it set my Emacs to whatever rules you make it so. I really only care that we all use a similar style. So if you go through and commit a file, I can get on installing that package.

vmai commented

Yeah I don't mind. The past few commits between me and @andbass have been rather messy since we keep on retabbing the files. If someone wants to tell me how I should be configuring this plugin, I'll gladly install it to make stuff work nicely.
In any case, I'm still currently using the smart-tabs config that we decided on when the project began in the summer of 2014 (Wow, it's been that long??)

rye commented

I'm interested to hear people's opinions here on this. I don't think we should include this stuff into FReCon, though. I'll close this issue unless someone makes a compelling argument for the reopening of it.

Alternatively, if somebody wanted to just email a configuration file around, we could all use it without committing it to the repository itself.

rye commented

I think that this suggestion works, but we could just commit it and then anyone who uses EditorConfig and wants to collaborate can do so. I will reopen because I like the idea again.

rye commented

There has been a little bit of discussion in the past about code style in this project, but I find it continually more and more problematic that we use tabs. My editor setup perfectly uses tabs, but I've spoken with a few interested minds who wish to contribute and cannot because their coding style would be improper.

I think that it's probably best to adhere to the Ruby Style Guide by bbatsov. Thus, we should switch to two-space tabs.

rye commented

As such, I'm going to write this in with a commit after changing the project's .editorconfig.