Skip to content

Instantly share code, notes, and snippets.

@gdotdesign
Last active August 29, 2015 14:06
Show Gist options
  • Save gdotdesign/2795b37d411d17b0a86b to your computer and use it in GitHub Desktop.
Save gdotdesign/2795b37d411d17b0a86b to your computer and use it in GitHub Desktop.
DiNa Rubocop Config
AllCops:
RunRailsCops: true
Style/AccessModifierIndentation:
EnforcedStyle: indent
Style/AlignHash:
Enabled: false
Style/AlignParameters:
Enabled: false
Style/AndOr:
EnforcedStyle: conditionals
Style/BarePercentLiterals:
EnforcedStyle: percent_q
Style/BracesAroundHashParameters:
Enabled: false
Style/CaseIndentation:
IndentWhenRelativeTo: end
Style/ClassAndModuleChildren:
EnforcedStyle: nested
Style/ClassCheck:
Enabled: false
Style/CollectionMethods:
Enabled: false
Style/CommentAnnotation:
Keywords:
- TODO
- FIXME
- OPTIMIZE
- HACK
- REVIEW
Style/DotPosition:
EnforcedStyle: trailing
Style/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true
Style/Encoding:
EnforcedStyle: when_needed
Style/For:
EnforcedStyle: each
Style/FormatString:
EnforcedStyle: format
Style/GlobalVars:
AllowedVariables: []
Style/GuardClause:
MinBodyLength: 1
Style/HashSyntax:
EnforcedStyle: ruby19
SupportedStyles:
- ruby19
- hash_rockets
Style/IfUnlessModifier:
MaxLineLength: 100
Style/IndentHash:
EnforcedStyle: special_inside_parentheses
Style/LambdaCall:
EnforcedStyle: call
Style/Next:
EnforcedStyle: skip_modifier_ifs
MinBodyLength: 3
Style/NonNilCheck:
IncludeSemanticChanges: false
Style/MethodDefParentheses:
EnforcedStyle: require_parentheses
Style/MethodName:
EnforcedStyle: snake_case
Style/NumericLiterals:
MinDigits: 5
Style/ParenthesesAroundCondition:
AllowSafeAssignment: true
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%': ()
'%i': ()
'%q': ()
'%Q': ()
'%r': '{}'
'%s': ()
'%w': ()
'%W': ()
'%x': ()
Style/PercentQLiterals:
EnforcedStyle: lower_case_q
Style/PredicateName:
NamePrefix:
- is_
- has_
- have_
NamePrefixBlacklist:
- is_
- has_
- have_
Style/RaiseArgs:
EnforcedStyle: exploded
Style/RedundantReturn:
AllowMultipleReturnValues: true
Style/RegexpLiteral:
MaxSlashes: 1
Style/Semicolon:
AllowAsExpressionSeparator: true
Style/SignalException:
EnforcedStyle: semantic
Style/SingleLineBlockParams:
Enabled: false
Style/SingleLineMethods:
AllowIfMethodIsEmpty: true
Style/StringLiterals:
EnforcedStyle: single_quotes
Style/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: space
Style/SpaceBeforeBlockBraces:
EnforcedStyle: space
Style/SpaceInsideBlockBraces:
EnforcedStyle: space
EnforcedStyleForEmptyBraces: no_space
SpaceBeforeBlockParameters: true
Style/SpaceInsideHashLiteralBraces:
EnforcedStyle: space
EnforcedStyleForEmptyBraces: no_space
Style/TrailingBlankLines:
EnforcedStyle: final_newline
Style/TrailingComma:
EnforcedStyleForMultiline: no_comma
Style/TrivialAccessors:
ExactNameMatch: false
AllowPredicates: false
Whitelist:
- to_ary
- to_a
- to_c
- to_enum
- to_h
- to_hash
- to_i
- to_int
- to_io
- to_open
- to_path
- to_proc
- to_r
- to_regexp
- to_str
- to_s
- to_sym
Style/VariableName:
EnforcedStyle: snake_case
Style/WhileUntilModifier:
MaxLineLength: 100
Style/WordArray:
MinSize: 0
##################### Metrics ##################################
Metrics/BlockNesting:
Max: 3
Metrics/ClassLength:
CountComments: false # count full line comments?
Max: 200
# Avoid complex methods.
Metrics/CyclomaticComplexity:
Max: 6
Metrics/LineLength:
Max: 100
AllowURI: true
URISchemes:
- http
- https
Metrics/MethodLength:
CountComments: false # count full line comments?
Max: 20
Metrics/ParameterLists:
Max: 5
CountKeywordArgs: true
Metrics/PerceivedComplexity:
Max: 7
##################### Lint ##################################
Lint/AssignmentInCondition:
AllowSafeAssignment: true
Lint/EndAlignment:
AlignWith: keyword
Lint/DefEndAlignment:
AlignWith: def
##################### Rails ##################################
Rails/ActionFilter:
EnforcedStyle: action
SupportedStyles:
- action
- filter
Include:
- app/controllers/**/*.rb
Rails/DefaultScope:
Include:
- app/models/**/*.rb
Rails/HasAndBelongsToMany:
Include:
- app/models/**/*.rb
Rails/Output:
Include:
- app/**/*.rb
- config/**/*.rb
- db/**/*.rb
- lib/**/*.rb
Rails/ReadWriteAttribute:
Include:
- app/models/**/*.rb
Rails/ScopeArgs:
Include:
- app/models/**/*.rb
Rails/Validation:
Include:
- app/models/**/*.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment