-
Notifications
You must be signed in to change notification settings - Fork 336
/
.rubocop.yml
171 lines (129 loc) · 3.26 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
161
162
163
164
165
166
167
168
169
170
171
require:
- rubocop-packaging
- rubocop-performance
- rubocop-rails
- rubocop-rspec
Rails:
Enabled: true
AllCops:
Exclude:
- lib/**/templates/*
- vendor/**/*
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 2.0
#################
# [i] Overrides #
#################
Style/CollectionMethods:
Enabled: true
# Mapping from undesired method to desired_method
# e.g. to use `detect` over `find`:
#
# CollectionMethods:
# PreferredMethods:
# find: detect
PreferredMethods:
reduce: 'inject'
find: 'detect'
each_with_index: 'each.with_index'
Style/EmptyMethod:
EnforcedStyle: expanded
# Align ends correctly.
Layout/EndAlignment:
EnforcedStyleAlignWith: variable
Layout/LineLength:
Max: 120
Style/SignalException:
EnforcedStyle: only_raise
Layout/SpaceInsideBlockBraces:
SpaceBeforeBlockParameters: true
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: space
Style/StringLiterals:
EnforcedStyle: double_quotes
#################
# Disabled cops #
#################
# We actually still work with ruby 2.0 but this setting only supports 2.4+
# We aren't going to drop old versions just to make rubocop happy.
Gemspec/RequiredRubyVersion:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/Documentation:
Enabled: false
Style/EachWithObject:
Enabled: false
Style/FormatString:
Enabled: false
Style/Lambda:
Enabled: false
Style/MultipleComparison:
Enabled: false
Style/NegatedIf:
Enabled: false
Style/PercentLiteralDelimiters:
PreferredDelimiters:
"%w": "[]"
"%W": "[]"
"%i": "[]"
"%I": "[]"
Style/Semicolon:
Enabled: false
Style/SingleLineBlockParams:
Enabled: false
Style/WordArray:
Enabled: false
# HABTM still has a place.
# http://collectiveidea.com/blog/archives/2014/08/11/has_and_belongs_to_many-isnt-dead/
Rails/HasAndBelongsToMany:
Enabled: false
Rails/RakeEnvironment:
Enabled: false
# enforces using the class name in a describe block (e.g. `describe TestedClass do`)
RSpec/DescribeClass:
Enabled: false
# enforces using the described_class variablea (`described_class` instead of MyClass)
RSpec/DescribedClass:
Enabled: false
# RSpec examples are ok if they're long.
# Explicitness is better than cleverness in tests.
RSpec/ExampleLength:
Enabled: false
# enforces using either `expect` or `allow` for stubs. Since they do different things,
# we should let the developer decide which to use
RSpec/MessageExpectation:
Enabled: false
# enforces having only one `expect` per test
RSpec/MultipleExpectations:
Enabled: false
RSpec/MultipleMemoizedHelpers:
Enabled: false
# enforces rules about how many nested `describe` blocks are allowed
RSpec/NestedGroups:
Enabled: false
# enforces rules about using `it` or `describe` block methods instead of `feature` or `scenario`
RSpec/Dialect:
Enabled: false
RSpec/SpecFilePathFormat:
Enabled: false
###################
# Local overrides #
###################
Rails/ApplicationRecord:
Enabled: false
Rails/SkipsModelValidations:
Enabled: false
Security/YAMLLoad:
Enabled: false
Style/FormatStringToken:
Enabled: false
Style/NumericPredicate:
Enabled: false