Skip to content

Instantly share code, notes, and snippets.

@yosukehasumi
Created April 9, 2020 05:35
Show Gist options
  • Save yosukehasumi/1ee5ab65de9f3214b9c46533a6039b1c to your computer and use it in GitHub Desktop.
Save yosukehasumi/1ee5ab65de9f3214b9c46533a6039b1c to your computer and use it in GitHub Desktop.
My preferred rubocop
# gem install rubocop-rails
# gem install rubocop-performance
# SublimeLinter Settings - User (if using rbenv)
# {
# "paths": {
# "osx": [
# "~/.rbenv/shims"
# ]
# }
# }
require:
- rubocop-rails
- rubocop-performance
# -------------------------------------------- Rails
Rails:
Enabled: true
Rails/Delegate:
Enabled: false
Rails/RefuteMethods:
Enabled: false
Rails/FilePath:
EnforcedStyle: slashes
Enabled: true
Rails/DynamicFindBy:
Enabled: false
Rails/HasAndBelongsToMany:
Enabled: false
# -------------------------------------------- Style
Style/Documentation:
Enabled: false
Style/FloatDivision:
Enabled: false
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/FrozenStringLiteralComment:
Enabled: false
Style/SymbolArray:
Enabled: true
Style/WordArray:
Enabled: false
Style/GlobalVars:
Enabled: true
Style/PreferredHashMethods:
Enabled: false
Style/Lambda:
Enabled: false
EnforcedStyle: literal
Style/SignalException:
EnforcedStyle: semantic
Enabled: true
Style/TernaryParentheses:
EnforcedStyle: require_parentheses_when_complex
Enabled: true
# -------------------------------------------- Layout
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedHashRocketStyle: table
Layout/LineLength:
Max: 150
Layout/ParameterAlignment:
Enabled: false
Layout/FirstArrayElementIndentation:
Enabled: false
Layout/EmptyLineAfterGuardClause:
Enabled: false
Layout/FirstArgumentIndentation:
Enabled: true
EnforcedStyle: consistent
Layout/HeredocIndentation:
Enabled: true
EnforcedStyle: squiggly
# -------------------------------------------- Metrics
Metrics/AbcSize:
Max: 75
Metrics/BlockLength:
Max: 41
Metrics/ClassLength:
Max: 435
Metrics/CyclomaticComplexity:
Max: 14
Metrics/MethodLength:
Max: 55
Metrics/ModuleLength:
Max: 310
Metrics/ParameterLists:
Max: 10
Metrics/PerceivedComplexity:
Max: 15
# -------------------------------------------- Naming
Naming/MethodName:
EnforcedStyle: snake_case
# -------------------------------------------- Performance
Performance/Casecmp:
Enabled: true
Performance/Count:
Enabled: true
Performance/FlatMap:
Enabled: true
Performance/RangeInclude:
Enabled: true
Performance/RegexpMatch:
Enabled: true
Performance/Size:
Enabled: true
# -------------------------------------------- Lint
Lint/RaiseException:
Enabled: false
Lint/StructNewOverride:
Enabled: false
Lint/UselessAssignment:
Enabled: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment