C83 / THP_2.0

0 stars 0 forks source link

Add Rubocop #3

Closed C83 closed 6 years ago

C83 commented 6 years ago

Why ?

Rubocop will help us to keep our code clean, and consistant and will warn us about various optimizations/best practices along the way.

Must have:

Reading list

C83 commented 6 years ago
  1. gem 'rubocop', '~> 0.57.2', require: false to fix the version of rubocop and bundle install
  2. gem "relaxed-rubocop" and inherit in .rubocop.yml file
  3. In the file :
    • DisplayStyleGuide: true and DisplayCopNames: true show a link and the name of cop source
    • AllCops: Exclude to exclude few files of the verification
    • Style/FrozenStringLiteralComment: Enabled: false : blank line between comment and code is optionnal
    • Metrics/BlockLength: Exclude: The length of a line is 80. The rule is inactive with few directory
  4. rubocop -a correct all "offenses". We can see the kind of cop and the rule's URL