Skip to content

Instantly share code, notes, and snippets.

@ruliana
Created June 13, 2018 02:21
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 ruliana/3bd764f616cf30a37dc2da634fcb7b90 to your computer and use it in GitHub Desktop.
Save ruliana/3bd764f616cf30a37dc2da634fcb7b90 to your computer and use it in GitHub Desktop.
My basic rubocop configuration
AllCops:
TargetRubyVersion: 2.4
DisplayCopNames: true
DisplayStyleGuide: true
Style/FrozenStringLiteralComment:
AutoCorrect: true
Style/RegexpLiteral:
Exclude:
- Guardfile
# We deal with s2 cell ids and geo hashes.
# Doesn't make sense to use this cop.
Style/NumericLiterals:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
# Include: **/Gemfile, **/gems.rb
Bundler/OrderedGems:
AutoCorrect: true
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
AllowHeredoc: true
AllowURI: true
IgnoredPatterns: true
Max: 100
# Sometimes we have portuguese in the comments
Style/AsciiComments:
Enabled: false
Style/Documentation:
Enabled: false
# Exclude:
# - 'spec/**/*'
# - 'test/**/*'
# Cop supports --auto-correct.
Layout/EmptyLineAfterMagicComment:
AutoCorrect: true
Exclude:
- 'Gemfile'
Style/ParallelAssignment:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
AutoCorrect: true
EnforcedStyle: no_space
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
EnforcedStyle: double_quotes
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: final_newline, final_blank_line
Layout/TrailingBlankLines:
AutoCorrect: true
# I like to create "Functional Constructors" as in "Link(a, b)" instead of "Link.new(a, b)"
# So I use a method for this in the spirit of "Array(xxx)"
Style/MethodName:
Enabled: false
Metrics/BlockLength:
Exclude:
- "spec/**/*"
- "link_community.gemspec"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment