-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
183 lines (151 loc) · 4.34 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
172
173
174
175
176
177
178
179
180
181
182
183
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
AllCops:
NewCops: enable
Exclude:
- 'vendor/**/*'
- 'test/fixtures/**/*'
- 'db/**/*'
- 'bin/**/*'
- 'log/**/*'
- 'tmp/**/*'
- 'app/views/**/*'
- 'config/environments/*'
- 'node_modules/**/*'
# Metrics Cops
Metrics/ClassLength:
Description: 'Avoid classes longer than 100 lines of code.'
Max: 100
Enabled: true
Metrics/ModuleLength:
Description: 'Avoid modules longer than 100 lines of code.'
Max: 100
Enabled: true
Metrics/ParameterLists:
Description: 'Pass no more than four parameters into a method.'
Max: 4
Enabled: true
Metrics/MethodLength:
Description: 'Avoid methods longer than 5 lines of code.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
Max: 5
Enabled: true
Metrics/BlockLength:
CountComments: false
Max: 5
IgnoredMethods:
- context
- describe
- it
- shared_examples
- shared_examples_for
- namespace
- draw
- configure
- group
# Style Cops
Style/BlockDelimiters:
Exclude:
- 'spec/**/*'
Style/SymbolArray:
Enabled: false
Style/ClassAndModuleChildren:
Description: 'Checks style of children classes and modules.'
Enabled: false
EnforcedStyle: nested
Style/CollectionMethods:
Enabled: true
PreferredMethods:
find: detect
inject: reduce
collect: map
find_all: select
Style/Documentation:
Description: 'Document classes and non-namespace modules.'
Enabled: false
Style/FrozenStringLiteralComment:
Description: >-
Add the frozen_string_literal comment to the top of files
to help transition from Ruby 2.3.0 to Ruby 3.0.
Enabled: true
Style/IfUnlessModifier:
Description: >-
Favor modifier if/unless usage when you have a
single-line body.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
Enabled: false
Style/InlineComment:
Description: 'Avoid inline comments.'
Enabled: false
Style/LineEndConcatenation:
Description: >-
Use \ instead of + or << to concatenate two string literals at
line end.
Enabled: true
Style/StringLiterals:
Description: 'Checks if uses of quotes match the configured preference.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
EnforcedStyle: single_quotes
Enabled: true
Style/TrailingCommaInArguments:
Description: 'Checks for trailing comma in argument lists.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
EnforcedStyleForMultiline: comma
SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
Enabled: true
Style/TrailingCommaInArrayLiteral:
Description: 'Checks for trailing comma in array literals.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
EnforcedStyleForMultiline: comma
SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
Enabled: true
Style/TrailingCommaInHashLiteral:
Description: 'Checks for trailing comma in hash literals.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
EnforcedStyleForMultiline: comma
SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
Enabled: true
# Layout Cops
Layout/ArgumentAlignment:
Exclude:
- 'config/initializers/*'
Layout/FirstArgumentIndentation:
Enabled: false
Layout/DotPosition:
Description: 'Checks the position of the dot in multi-line method calls.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
Enabled: false
Layout/LineLength:
Description: 'Limit lines to 120 characters.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
Max: 120
Layout/MultilineOperationIndentation:
Description: >-
Checks indentation of binary operations that span more than
one line.
Enabled: true
EnforcedStyle: indented
Layout/MultilineMethodCallIndentation:
Description: >-
Checks indentation of method calls with the dot operator
that span more than one line.
Enabled: true
EnforcedStyle: indented
# Rails Cops
Rails/Delegate:
Description: 'Prefer delegate method for delegations.'
Enabled: false
# Bundler Cops
Bundler/OrderedGems:
Enabled: false