Skip to content

Instantly share code, notes, and snippets.

@fran-worley
Created April 10, 2018 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fran-worley/0da5ab425ef10b0f0cfcdd3d15597c9a to your computer and use it in GitHub Desktop.
Save fran-worley/0da5ab425ef10b0f0cfcdd3d15597c9a to your computer and use it in GitHub Desktop.
rubocop config - operation friendly(ish)
AllCops:
TargetRubyVersion: '2.5'
Exclude:
- 'cache/**/*'
- 'bin/*'
- 'db/**/*'
- 'test/test_helper.rb'
- '*.gemspec'
Documentation:
Enabled: false
# disable this for tests as blocks will always be too long
Metrics/BlockLength:
Exclude:
- 'test/**/*'
# I really don't care what you do here, though I like to minimise indentation where possible
Style/ClassAndModuleChildren:
Enabled: false
# use {} over multiple lines if the return value of the block is important
# Bad example but you get the point:
# new_array = array.map { |item|
# next if item == 'green'
# item
# }.compact
Style/BlockDelimiters:
Enabled: false
# not operation friendly. It can be useful to name our step methods set_*
Naming/AccessorMethodName:
Enabled: false
# not operation macro friendly. Convention is to have methods in CamelCase
Naming/MethodName:
Enabled: false
Metrics/LineLength:
Max: 150 # can be extended up to 200
# saves us a few characters and once you know what .() what's the point in .call()?
Style/LambdaCall:
EnforcedStyle: braces
# always use -> for lambdas even over multilines
Style/Lambda:
EnforcedStyle: literal
Layout/AlignParameters:
EnforcedStyle: with_fixed_indentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment