-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.rubocop.yml
More file actions
167 lines (127 loc) · 3.64 KB
/
.rubocop.yml
File metadata and controls
167 lines (127 loc) · 3.64 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
plugins:
- rubocop-minitest
AllCops:
TargetRubyVersion: 3.2
NewCops: enable
Exclude:
- 'vendor/**/*'
- 'bin/**/*'
- 'tmp/**/*'
# Style Configuration to match existing project standards
# Indentation: 2 spaces (matches existing code)
Layout/IndentationWidth:
Width: 2
# String quotes: prefer single quotes (matches existing code)
Style/StringLiterals:
EnforcedStyle: single_quotes
# Allow both single and double quotes in string interpolation contexts
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
# Method definitions: allow no parentheses for no arguments (matches existing code)
Style/DefWithParentheses:
Enabled: false
# Method calls: allow no parentheses for no arguments (matches existing code)
Style/MethodCallWithoutArgsParentheses:
Enabled: true
# Hash syntax: prefer symbols (matches existing code)
# Line length: be reasonable but not too strict for a Ruby gem
Layout/LineLength:
Max: 120
AllowedPatterns: ['\A\s*#']
Exclude:
- '*.gemspec'
- 'test/**/*'
# Documentation: don't require class/module documentation for this gem type
Style/Documentation:
Enabled: false
# Frozen string literal: don't enforce for compatibility
Style/FrozenStringLiteralComment:
Enabled: false
# Allow both proc and lambda
Style/Lambda:
Enabled: false
# Allow multiple assignment
Style/ParallelAssignment:
Enabled: false
# Allow guard clauses
Style/GuardClause:
Enabled: true
# Allow both if and unless modifiers
Style/IfUnlessModifier:
Enabled: true
# Method length: be reasonable for small gem
Metrics/MethodLength:
Max: 25
# Class length: be reasonable for small gem
Metrics/ClassLength:
Max: 200
# Module length: be reasonable for small gem
Metrics/ModuleLength:
Max: 200
# Block length: allow longer blocks for tests and configuration
Metrics/BlockLength:
Max: 50
Exclude:
- 'test/**/*'
- '*.gemspec'
- 'Rakefile'
# Allow both foo.empty? and foo.size == 0
Style/ZeroLengthPredicate:
Enabled: false
# Allow memoized variables with different names (e.g., @_sequelizer_db for @db)
Naming/MemoizedInstanceVariableName:
Enabled: false
# Allow short parameter names (common in Ruby for simple methods)
Naming/MethodParameterName:
MinNameLength: 1
# Allow multi-line block chains (common in Ruby data processing)
Style/MultilineBlockChain:
Enabled: false
# Relax complexity metrics for existing code
Metrics/AbcSize:
Max: 35
Exclude:
- 'test/**/*'
Metrics/CyclomaticComplexity:
Max: 15
Metrics/PerceivedComplexity:
Max: 12
Metrics/BlockNesting:
Max: 4
# Allow set_ prefixed methods (common pattern)
Naming/AccessorMethodName:
Enabled: false
# Allow both string and symbol keys in same hash for configuration
Style/HashSyntax:
EnforcedStyle: ruby19
EnforcedShorthandSyntax: either
# Minitest specific rules
Minitest/AssertEqual:
Enabled: true
Minitest/RefuteEqual:
Enabled: true
# Layout rules that match existing code
Layout/EmptyLinesAroundClassBody:
EnforcedStyle: empty_lines_except_namespace
Layout/EmptyLinesAroundModuleBody:
EnforcedStyle: empty_lines_except_namespace
# Allow trailing commas in multiline structures
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
# Disable gemspec-specific rules that don't apply to this project
Gemspec/DevelopmentDependencies:
Enabled: false
# Disable some style rules for tests to allow more flexibility
Style/HashLikeCase:
Exclude:
- 'test/**/*'
Lint/DuplicateBranch:
Exclude:
- 'test/**/*'
Style/StringConcatenation:
Exclude:
- 'test/**/*'