-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.rubocop.yml
More file actions
193 lines (143 loc) · 3.43 KB
/
.rubocop.yml
File metadata and controls
193 lines (143 loc) · 3.43 KB
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
184
185
186
187
188
189
190
191
192
193
# RuboCop configuration for GetStream Ruby SDK
AllCops:
TargetRubyVersion: 2.6
NewCops: enable
Exclude:
- 'vendor/**/*'
- 'tmp/**/*'
- 'spec/fixtures/**/*'
- 'lib/getstream_ruby/generated/**/*' # Generated code
- 'test/**/*' # Legacy test files
# Style configurations
Style/Documentation:
Enabled: false # Disable for generated files
Style/StringLiterals:
EnforcedStyle: single_quotes
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
# Layout configurations
Layout/LineLength:
Max: 120
Exclude:
- 'lib/getstream_ruby/generated/**/*'
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/HashAlignment:
EnforcedColonStyle: key
EnforcedHashRocketStyle: key
# Metrics configurations
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'Rakefile'
Metrics/MethodLength:
Max: 40
Exclude:
- 'lib/getstream_ruby/generated/**/*'
Metrics/ClassLength:
Max: 250
Exclude:
- 'lib/getstream_ruby/generated/**/*'
Metrics/ParameterLists:
Max: 8 # ApiError mirrors the canonical APIError envelope.
Exclude:
- 'lib/getstream_ruby/generated/**/*'
Metrics/ModuleLength:
Max: 200
Exclude:
- 'lib/getstream_ruby/generated/**/*'
Metrics/AbcSize:
Max: 50
Exclude:
- 'lib/getstream_ruby/generated/**/*'
Metrics/CyclomaticComplexity:
Max: 20
Exclude:
- 'lib/getstream_ruby/generated/**/*'
Metrics/PerceivedComplexity:
Max: 25
Exclude:
- 'lib/getstream_ruby/generated/**/*'
# Lint configurations
Lint/UnusedMethodArgument:
AllowUnusedKeywordArguments: true
Lint/UnusedBlockArgument:
AllowUnusedKeywordArguments: true
Lint/ShadowingOuterLocalVariable:
Exclude:
- 'spec/**/*'
# Naming configurations
Naming/VariableNumber:
EnforcedStyle: snake_case
# Security configurations
Security/YAMLLoad:
Enabled: true
Security/JSONLoad:
Enabled: true
Security/MarshalLoad:
Enabled: true
# Bundler configurations
Bundler/OrderedGems:
Enabled: true
# Custom configurations
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
Style/IfUnlessModifier:
Enabled: true
Style/GuardClause:
MinBodyLength: 2
Style/EmptyMethod:
EnforcedStyle: expanded
Layout/EmptyLinesAroundBlockBody:
EnforcedStyle: empty_lines
Layout/EmptyLinesAroundClassBody:
EnforcedStyle: empty_lines
Layout/EmptyLinesAroundModuleBody:
EnforcedStyle: empty_lines
Layout/EmptyLinesAroundMethodBody:
Enabled: true
# Disable some cops that are too strict for this project
Style/WordArray:
Enabled: false
Style/SymbolArray:
Enabled: false
Style/PercentLiteralDelimiters:
Enabled: false
Style/AsciiComments:
Enabled: false
Style/Encoding:
Enabled: false
Style/LineEndConcatenation:
Enabled: false
Style/RegexpLiteral:
Enabled: false
Style/TrivialAccessors:
Enabled: false
Style/VariableInterpolation:
Enabled: false
Style/WhenThen:
Enabled: false
Style/WhileUntilModifier:
Enabled: false
Style/YodaCondition:
Enabled: false
# Disable cops that conflict with generated code
Style/ClassAndModuleChildren:
Enabled: false
Naming/ConstantName:
Exclude:
- 'lib/getstream_ruby/generated/**/*'
Style/ClassVars:
Exclude:
- 'lib/getstream_ruby/generated/**/*'
Style/GlobalVars:
Exclude:
- 'lib/getstream_ruby/generated/**/*'
Gemspec/RequireMFA:
Enabled: false