Skip to content
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

Code style #2050

Closed
tiennou opened this issue Apr 15, 2015 · 0 comments
Closed

Code style #2050

tiennou opened this issue Apr 15, 2015 · 0 comments

Comments

@tiennou
Copy link
Member

@tiennou tiennou commented Apr 15, 2015

I'm filing a new issue so we can discuss that ;-). I'm investigating some style guide I'd like us to all use when coding. @skurfer told me we preferred 4 spaces, so I went along and built a quick Ruby script so I could be sure we were going the right way.

Here's the script : https://gist.github.com/tiennou/4a4561e55050234b0031
The results of ./indent-stat.rb "*.[hm]" are {:files=>562, :tabs=>29451, :spaces=>16996}.

That's 63% tabs. This means I'd like to switch to tabs because there's almost 2 times more lines that begin with those.

And then I'd propose going setting that style as "canonical", with an exemption w.r.t to us using tabs for indent.

Some insight on the tab/space wars : 1 + followup.

There's also a bunch of links at the end of the style guide above which points to more style guides. Feel free to take a look at them, but I just took the first one I found that looked like something I'd want to enforce.

Fun fact: our "Initial commit to GC" is {:files=>713, :tabs=>35909, :spaces=>19675}. That's 64% tabs. I'll let you guess which commit caused a drop of almost 200 files ;-).

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

No branches or pull requests

1 participant