11# StreamSource RuboCop Configuration
2- # Rails-focused linting with sensible defaults
32
43plugins :
54 - rubocop-rails
6- - rubocop-performance
5+ - rubocop-performance
76 - rubocop-rspec
87
98AllCops :
10- TargetRubyVersion : 3.3
11- TargetRailsVersion : 8.0
12- SuggestExtensions : false
9+ TargetRubyVersion : 4.0
10+ TargetRailsVersion : 8.1
1311 NewCops : enable
12+ SuggestExtensions : false
1413 Exclude :
1514 - ' bin/**/*'
1615 - ' tmp/**/*'
@@ -23,41 +22,57 @@ AllCops:
2322 - ' public/**/*'
2423 - ' storage/**/*'
2524 - ' Gemfile.lock'
26- - ' config/environments/production.rb'
2725 - ' config/boot.rb'
2826 - ' config/application.rb'
27+ - ' config/environments/production.rb'
2928
30- # Project-specific overrides
3129Rails :
3230 Enabled : true
3331
34- # Allow longer lines for API documentation and complex queries
32+ # Keep Rails conventions; allow slightly more flexibility in specs.
3533Layout/LineLength :
3634 Max : 120
3735 AllowedPatterns :
38- - ' \A\s*#.*\z' # Comments
39- - ' \A\s*it\s.*\z' # RSpec test descriptions
40- - ' \A\s*describe\s.*\z' # RSpec describe blocks
41- - ' \A\s*context\s.*\z' # RSpec context blocks
36+ - ' \\A\\s*#.*\\z'
37+ - ' \\A\\s*it\\s.*\\z'
38+ - ' \\A\\s*describe\\s.*\\z'
39+ - ' \\A\\s*context\\s.*\\z'
40+
41+ Style/StringLiterals :
42+ EnforcedStyle : double_quotes
43+ ConsistentQuotesInMultiline : true
44+
45+ Style/ClassAndModuleChildren :
46+ EnforcedStyle : nested
47+
48+ Style/FrozenStringLiteralComment :
49+ EnforcedStyle : never
50+
51+ Style/SingleLineMethods :
52+ AllowIfMethodIsEmpty : true
53+
54+ Style/TrailingCommaInArrayLiteral :
55+ EnforcedStyleForMultiline : comma
56+
57+ Style/TrailingCommaInHashLiteral :
58+ EnforcedStyleForMultiline : comma
59+
60+ Style/TrailingCommaInArguments :
61+ EnforcedStyleForMultiline : comma
4262
43- # Allow longer methods for complex Rails actions and RSpec tests
4463Metrics/MethodLength :
4564 Max : 20
4665 CountAsOne : ['array', 'heredoc']
4766 Exclude :
4867 - ' spec/**/*'
49- - ' app/controllers/**/*'
5068 - ' config/routes.rb'
5169
52- # Allow longer classes for controllers and models with many methods
5370Metrics/ClassLength :
5471 Max : 150
5572 CountAsOne : ['array', 'heredoc']
5673 Exclude :
5774 - ' spec/**/*'
58- - ' app/controllers/**/*'
5975
60- # Allow longer blocks for RSpec and routes
6176Metrics/BlockLength :
6277 Max : 25
6378 CountAsOne : ['array', 'heredoc']
@@ -68,120 +83,32 @@ Metrics/BlockLength:
6883 - ' Guardfile'
6984 - ' Rakefile'
7085
71- # Disable ABC size for complex methods (often needed in Rails)
7286Metrics/AbcSize :
73- Enabled : false
87+ Max : 25
88+ Exclude :
89+ - ' spec/**/*'
7490
75- # Allow complexity in controllers and specs
7691Metrics/CyclomaticComplexity :
7792 Max : 10
7893 Exclude :
7994 - ' spec/**/*'
8095
81- # More flexible on parameter counts for controllers
96+ Metrics/PerceivedComplexity :
97+ Max : 10
98+ Exclude :
99+ - ' spec/**/*'
100+
82101Metrics/ParameterLists :
83102 Max : 8
84103
85- # Allow assignment in conditions (common Rails pattern)
86- Lint/AssignmentInCondition :
87- Enabled : false
88-
89- # Allow empty when (useful for case statements)
90- Lint/EmptyWhen :
91- Enabled : false
92-
93- # Documentation requirements - be more lenient
94- Style/Documentation :
95- Enabled : false
96-
97- # Allow compact module/class definitions
98- Style/ClassAndModuleChildren :
99- Enabled : false
100-
101- # Flexible on frozen string literals (Rails handles this)
102- Style/FrozenStringLiteralComment :
103- Enabled : false
104-
105- # Allow single line methods
106- Style/SingleLineMethods :
107- AllowIfMethodIsEmpty : true
108-
109- # Allow guard clauses
110- Style/GuardClause :
111- Enabled : true
112-
113- # Be flexible with hash syntax in Rails
114- Style/HashSyntax :
115- EnforcedStyle : ruby19
116-
117- # Allow trailing commas (good for Git diffs)
118- Style/TrailingCommaInArrayLiteral :
119- EnforcedStyleForMultiline : comma
120-
121- Style/TrailingCommaInHashLiteral :
122- EnforcedStyleForMultiline : comma
123-
124- Style/TrailingCommaInArguments :
125- EnforcedStyleForMultiline : comma
126-
127- # Be more flexible with string literals
128- Style/StringLiterals :
129- EnforcedStyle : double_quotes
130- ConsistentQuotesInMultiline : true
131-
132- # Allow both lambda styles
133- Style/Lambda :
134- Enabled : false
135-
136- # Naming conventions
137- Naming/VariableNumber :
138- EnforcedStyle : snake_case
139-
140- Naming/PredicatePrefix :
141- ForbiddenPrefixes :
142- - is_
143- - have_
144- AllowedMethods :
145- - is_a?
104+ RSpec/ExampleLength :
105+ Max : 12
146106
147- # Rails cops will be loaded from rubocop-rails gem
107+ RSpec/MultipleExpectations :
108+ Max : 3
148109
149- # Performance cops will be loaded from rubocop-performance gem
150-
151- # Security cops
152- Security/YAMLLoad :
153- Enabled : true
154-
155- Security/Eval :
156- Enabled : true
157-
158- # RSpec cops will be loaded from rubocop-rspec gem
159-
160- # Bundler cops
161- Bundler/OrderedGems :
162- Enabled : false
163-
164- # Disable cops that conflict with Rails conventions
165- Layout/EmptyLinesAroundAttributeAccessor :
166- Enabled : false
167-
168- Layout/SpaceAroundMethodCallOperator :
169- Enabled : true
170-
171- Lint/RaiseException :
172- Enabled : true
173-
174- Lint/StructNewOverride :
175- Enabled : true
176-
177- Style/ExponentialNotation :
178- Enabled : true
179-
180- Style/HashEachMethods :
181- Enabled : true
182-
183- Style/HashTransformKeys :
184- Enabled : true
110+ RSpec/MultipleMemoizedHelpers :
111+ Max : 7
185112
186- Style/HashTransformValues :
187- Enabled : true
113+ RSpec/NestedGroups :
114+ Max : 4
0 commit comments