Skip to content

Commit 87caae7

Browse files
committed
chore: update RuboCop configuration for Rails idioms
Configure RuboCop with pragmatic settings for Rails development: Exclusions added: - Allow larger service classes for complex business logic - Allow larger controller classes with multiple actions - Exclude services and controllers from strict Metrics cops Cops disabled: - Naming/PredicateMethod (import_*, create_* are not predicates) - Naming/PredicatePrefix (has_*, is_* are Rails idioms) Metrics adjusted: - Services and Controllers excluded from MethodLength/AbcSize/ClassLength - Focus on real issues, not Rails patterns This reduces false positives and aligns with Rails best practices.
1 parent a029151 commit 87caae7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.rubocop.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,22 @@ Metrics/MethodLength:
3535
Max: 15
3636
Exclude:
3737
- 'db/migrate/*'
38+
- 'app/**/services/*_service.rb' # Complex business logic services
39+
- 'app/**/controllers/*_controller.rb' # Controllers with multiple actions
3840

3941
Metrics/ClassLength:
4042
Max: 150
43+
Exclude:
44+
- 'app/**/services/*_service.rb' # Allow larger service classes
45+
- 'app/**/controllers/*_controller.rb' # Controllers with many actions
46+
- 'config/initializers/**/*'
4147

4248
Metrics/AbcSize:
4349
Max: 20
4450
Exclude:
4551
- 'db/migrate/*'
52+
- 'app/**/services/*_service.rb' # Complex business logic
53+
- 'app/**/controllers/*_controller.rb' # Controller actions
4654

4755
Metrics/CyclomaticComplexity:
4856
Max: 10
@@ -65,6 +73,9 @@ Metrics/ParameterLists:
6573
Naming/PredicatePrefix:
6674
Enabled: false
6775

76+
Naming/PredicateMethod:
77+
Enabled: false # Disable predicate method naming (import_*, create_* are not predicates)
78+
6879
Naming/VariableNumber:
6980
Enabled: false
7081

0 commit comments

Comments
 (0)