Reputation: 245
Currently I'm getting feedback from Rubocop saying "Avoid parameter lists longer than 5 parameters."
What is the #Rubocop:disable command to disable this? I'm happy with the code having an extra argument so I don't want to change it.
Upvotes: 7
Views: 8915
Reputation: 4176
# rubocop:disable Metrics/ParameterLists
your function goes here
# rubocop:enable Metrics/ParameterLists
Upvotes: 4
Reputation: 362
For your convenience, here is my .rubocop.yml I frequently used.
See formal explanation of .rubocop.yml here.
AllCops: Excludes: - Berksfile - recipes/basic.rb - attributes/*.rb # Customize rules Metrics/LineLength: Max: 95 MethodLength: Max: 35 Metrics/AbcSize: Enabled: false BlockLength: Max: 70
I constantly bump by rubocop errors and warning. Thus I've published this post.
Common Rubocop Errors: Improve Your Ruby Code Quality
Upvotes: 3
Reputation: 2210
You could drop a file named .rubocop.yml
in your project root directory with the following content.
Metrics/ParameterLists:
Enabled: false
Upvotes: 8