-
Notifications
You must be signed in to change notification settings - Fork 1
/
rubocop.yml
160 lines (132 loc) · 3.86 KB
/
rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Override default Rubocop confg
# See https://github.com/bbatsov/rubocop
AllCops:
NewCops: enable
SuggestExtensions: false
Layout/DotPosition:
EnforcedStyle: leading
Layout/EmptyLineAfterGuardClause:
# We disable this rule to allow each developer
# to choose the appropriate style.
#
# For example, the following example couldn't reach
# a consensus :
#
# odds = []
# 10.times.each do |i|
# next if i % 2 == 0
#
# odds << i
# end
#
Enabled: false
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: space
EnforcedStyleForEmptyBraces: no_space
##################################### Style ####################################
# Please keep rules in alphabetical order...
Style/AsciiComments:
# Because 👆 is not the finger you are looking for.
Enabled: false
Style/ClassAndModuleChildren:
# Checks the style of children definitions at classes and modules.
#
# Basically there are two different styles:
#
# `nested` - have each child on a separate line
# class Foo
# class Bar
# end
# end
#
# `compact` - combine definitions as much as possible
# class Foo::Bar
# end
#
# There are good reasons to use both, do not enforce this style.
Enabled: false
Style/CommentedKeyword:
# Checks if a comment is added after a keyword:
#
# class Foo < ActiveRecord::Base # Not AppRecord, this is specific
#
# We don't have any specific reason to disallow it.
Enabled: false
Style/Documentation:
Enabled: false
Style/DocumentationMethod:
Enabled: true
Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys
SupportedStyles:
# checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
- ruby19
# checks for hash rocket syntax for all hashes
- hash_rockets
# forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
- no_mixed_keys
# enforces both ruby19 and no_mixed_keys styles
- ruby19_no_mixed_keys
# Force hashes that have a symbol value to use hash rockets
UseHashRocketsWithSymbolValues: false
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
PreferHashRocketsForNonAlnumEndingSymbols: false
# Do not assign mutable objects to constants.
Style/MutableConstant:
Enabled: true
EnforcedStyle: strict
# Do not enforce usage of `unless foo` over `if !foo`
Style/NegatedIf:
Enabled: false
Style/NumericPredicate:
# Disabled : depending on the context, we think it's a good thing
# to have the choice between `> 0` and `positive?`.
EnforcedStyle: comparison
Style/PercentLiteralDelimiters:
# Why do we need different delimiters ?!
# Always use the `()` delimiter
PreferredDelimiters:
default: '()'
'%i': '()'
'%I': '()'
'%r': '()'
'%w': '()'
'%W': '()'
Style/RedundantReturn:
# Allow usage of `return` keyword when it helps clarity.
Enabled: false
Style/ReturnNil:
# Favor usage of `return nil` in stead of `return`
EnforcedStyle: return_nil
Style/StringLiterals:
EnforcedStyle: double_quotes
# If true, strings which span multiple lines using \ for continuation must
# use the same type of quotes on each line.
ConsistentQuotesInMultiline: true
# Since we always want to enforce double quotes, having single quotes on such
# places feels weird:
#
# "Hello, #{APP_CONFIG['little_world']"
#
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
#################################### Metrics ###################################
# Please keep rules in alphabetical order...
Metrics/AbcSize:
# Default 15 (9999 to disable it)
# => cyclomatic complexity is better
Max: 9999
Metrics/BlockLength:
Exclude:
- "spec/**/*"
Metrics/ClassLength:
CountComments: false # count full line comments?
Max: 300
Metrics/ModuleLength:
CountComments: false # count full line comments?
Max: 300
Metrics/MethodLength:
CountComments: false # count full line comments?
Max: 20
Layout/LineLength:
Max: 80