sgruhier / foundation_rails_helper

Rails Helper for Zurb Fondation framework
MIT License
152 stars 84 forks source link

Add rubocop #119

Closed dsandstrom closed 8 years ago

dsandstrom commented 8 years ago

Lately, I've been using the rubocop linter, which follows the Ruby Style Guidline. I feel it keeps my code consistent and easy to read. I purpose we add rubocop configs (.rubocop.yml) to this gem and enforce code style for future additions. Also, I've added a linting step to our Travis CI so checking style is less painful. Of course, the settings we choose for the rubocop configs are open to debate.

Where I deviate a little from the norm is I like to use double quotes in my spec files, while single everywhere else.

I'm willing to go through the code and fix any errors.

andreslemik commented 8 years ago

why not generate .rubocop_todo.yml? or correct files listed in rubocop check report?

dsandstrom commented 8 years ago

I've never used the todo functionality, what is the benefit?

dgmstuart commented 8 years ago

@dsandstrom Two reasons:

  1. to exclude cases which rubocop flags up, but there are genuine reasons for not following a specific style rule.
  2. To allow you to start off with a clean slate: start using rubocop straight away and highlight style issues with new code, while fixing style issues in older code in slow time.
andreslemik commented 8 years ago

@dsandstrom rubocop --autogen-config - generate a configuration file acting as a TODO list. After that rubocop will not raise errors listed in rubocop_todo.yml and we will fix them later.

dgmstuart commented 8 years ago

Closed in favour of #143