-
Notifications
You must be signed in to change notification settings - Fork 138
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Adopt a code style guide #58
Comments
As an update to this, I'd recommend using HoundCI as an automated way of enforcing the style guide. It only complains about diffs, so it won't comment on the entire repo. By default HoundCI uses the thoughtbot style guide, but it can be tweaked with a |
Are you sure this won't cause all PRs to be spammed by houndi? Last time I used it, it was pretty noisy, and this codebase is very non-standard. |
It will comment in every pull request on style transgressions, but only on changed lines. While this means it won't complain about everything in an affected file, there is indeed a chance that the diffs coming in would contain multiple style transgressions. It's hard to say how many that would be, but we would most likely have at least one complaint for every PR. |
While I think having a consistent style is useful (but not essential), given how little time everyone has and the needs of this project at present, I believe that this may initially be counterproductive. If someone submits a pull request and a few things aren't up to spec technically, yeah, we should sort it out, but style, I think we can leave that up to common sense for now. |
As an addendum, obviously things which are horribly organised or laid out should be fixed... I don't think anyone needs to refer to a style guide, either merge the PR and fix the style issue or ask the contributor to make the change. However, I think going back to the PR on issues like whitespace is pretty much a waste of everyones time, faster just to merge and fix the issues. |
This is a fair point; most people are probably neither as adamant as I am about code style and structure. Hound would probably be overkill. I still think that the adoption of a style guide would be helpful to at least have something to point towards if the look of some supplied code is egregious. |
@linduxed I really appreciate your POV and I think it's great to have someone on board who will do as you are proposing. Let's work on it, but firstly, lets try to fix the major outstanding issues with the code and get a proper release out. |
So, can we table this issue and maybe just add something like https://github.com/metricfu/metric_fu/blob/master/spec/quality_spec.rb |
Let us enable Hound when it will be impossible to work without it (when maintainers will be drowning in badly formatted PRs). But no sooner. It will be a loss if some brave contributor will go away after a comment left by Hound. |
Personally, I'm more likely to contribute to a project that has a style guide and some CI built around it. However, I'm not crazy about the way HoundCI works. If at any point the project gets pretty thoroughly ratcheted down in terms of style, new pull requests from people unfamiliar with the guide will spam everybody with comment notifications. Being that they're just using Rubocop behind the scenes, it's not that hard to plug into Travis and have it fail the build, where then you can go and look at the list of violations instead. |
That's a good idea. I'm afraid though that a stand-alone Rubocop will produce a lot of noise because existing source does not conform to the community guide. Offenses related only to a certain pull request will be lost in the long list.= |
Actually, rubocop is configurable, too. What I've done in this pull request is disable all of the rules, and then we can enable them one by one as we clean up the code. |
@mockdeep changed my opinion on Hound. At the moment, it's the best tool for style checking. It doesn't interfere with the main build. It only comments on changes. I suggest that we should enable it. |
@vassilevsky I guess I don't see the problem with it causing the build to fail when people introduce style guide violations. It prevents code from being merged that is not consistent with the team's standards. A couple of problems I see with hound:
It's not a huge deal, overall, I guess, but I prefer a stricter approach where the control is in our hands. |
Considering Hound was recently (at least so it seems) turned on for this project, I'm thinking it is even more relevant to settle for some style guide and add a Currently we've got a |
The existing |
Yes, I enabled Hound because why not :) I had no idea Thoughbot prefers double quotes everywhere. I have now committed the I recently deleted a lot of rules from I think that we need to continue deleting stuff from |
Yeah, I was going to try to get the test coverage up before jumping into rubocop completely, but most of it should be harmless. First thing is converting over to RSpec... not enough time... |
Sounds good. If you want to introduce rspec just have it run with
testunit, and occasionally move specs over :)
|
Yep, that's the plan. |
I think this is no longer an issue. |
Issue by linduxed
Saturday Nov 02, 2013 at 15:11 GMT
Originally opened as #93
Since I've started to look at some of the PRs here (along with the actual code) it would be nice to have an officially adopted style guide.
This would allow someone reviewing the code to point to specific issues in the code and reference the guide as a set of rules for what can and can't go into the code base.
I'm proposing the use of thoughtbot's "guides" repository as a start, since it's of high quality and constantly refined.
The text was updated successfully, but these errors were encountered: