Skip to content

Instantly share code, notes, and snippets.

@mizalewski
Last active March 21, 2018 07:33
Show Gist options
  • Save mizalewski/2fd40ead157e2d46e355cc94ad79b037 to your computer and use it in GitHub Desktop.
Save mizalewski/2fd40ead157e2d46e355cc94ad79b037 to your computer and use it in GitHub Desktop.
Opinionated Rubocop configuration
AllCops:
TargetRubyVersion: 2.5 # set your Ruby version
Exclude:
- 'bin/**/*'
- 'tmp/**/*'
- 'vendor/**/*'
- 'db/**/*'
- 'node_modules/**/*'
- '**/config/routes.rb'
- '**/environments/*.rb'
Rails:
Enabled: true
Metrics/LineLength:
Max: 120
Description: 'Limit lines to 120 characters.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
Enabled: true
Style/AutoResourceCleanup:
Description: 'Suggests the usage of an auto resource cleanup version of a method (if available).'
Enabled: true
Style/EmptyLineAfterGuardClause:
Description: 'Add empty line after guard clause.'
Enabled: true
Style/ImplicitRuntimeError:
Description: >-
Use `raise` or `fail` with an explicit exception class and
message, rather than just a message.
Enabled: true
Style/InlineComment:
Description: 'Avoid trailing inline comments.'
Enabled: true
Style/MethodCalledOnDoEndBlock:
Description: 'Avoid chaining a method call on a do...end block.'
StyleGuide: '#single-line-blocks'
Enabled: true
Style/OptionHash:
Description: "Don't use option hashes when you can use keyword arguments."
Enabled: true
Style/Send:
Description: 'Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` may overlap with existing methods.'
StyleGuide: '#prefer-public-send'
Enabled: true
Style/StringMethods:
Description: 'Checks if configured preferred methods are used over non-preferred.'
Enabled: true
Style/Documentation:
Description: 'Document classes and non-namespace modules.'
Enabled: false
Exclude:
- 'spec/**/*'
- 'test/**/*'
Rails/InverseOf:
Description: 'Checks for associations where the inverse cannot be determined automatically.'
Enabled: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment