sup icon indicating copy to clipboard operation
sup copied to clipboard

Follow GH Ruby styleguide

Open ZJvandeWeg opened this issue 9 years ago • 7 comments

When reading through the source you'll notice alot of different style used. Im under the impression that nobody reads HACKING and therefor propose to switch to the Github Ruby Styleguide for all future commit as it seems more 'standard' than HACKING.

ZJvandeWeg avatar Mar 08 '15 18:03 ZJvandeWeg

Why not introducing https://github.com/bbatsov/rubocop to the project? You can add this to the rake task running the test suite. This will check/ensure the Community Ruby Styleguide https://github.com/bbatsov/ruby-style-guide.

maxmeyer avatar Mar 09 '15 05:03 maxmeyer

Could rubocops output automatically be posted on PR's as Travis now does?

ZJvandeWeg avatar Mar 09 '15 06:03 ZJvandeWeg

There's no need for that from my point of view. You could use their rake-task and make your test-task to depend on that:

task test: %w(test:rubocop test:minitest)

Then add something like this to .travis.yml:

[...]
script: rake test
[...]

On every push to github rake test is run. And because it depends on rake test:rubocop, rubocop runs before the minitest-testsuite is run. And it fails with an understandable error message which exactly tell what you need to fix.

BTW You want something like this in your .rubocop.yml.

AllCops:
  Exclude:
    - 'tmp/**/*'
  DisplayCopNames: true

maxmeyer avatar Mar 09 '15 18:03 maxmeyer

Thanks. Im interested in what @gauteh thinks about this?

ZJvandeWeg avatar Mar 09 '15 20:03 ZJvandeWeg

That would probably be good, but it also requires us to go through the old source and fix it.

gauteh avatar Mar 10 '15 08:03 gauteh

Ill have time on my hands in the near future. I can pick this up, though I would like some help if possible.

ZJvandeWeg avatar Mar 10 '15 10:03 ZJvandeWeg

Could rubocops output automatically be posted on PR's as Travis now does?

Hound does: https://houndci.com/

rumpelsepp avatar Aug 12 '15 17:08 rumpelsepp