-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.rubocop.yml
More file actions
162 lines (130 loc) · 3.71 KB
/
.rubocop.yml
File metadata and controls
162 lines (130 loc) · 3.71 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
# RuboCop Configuration for ProStaff API
# Ruby on Rails 7.2+ API with Ruby 3.4.8
#
# This configuration balances code quality with pragmatic Rails development.
# Generated: 2025-10-23
AllCops:
NewCops: enable
TargetRubyVersion: 3.4
SuggestExtensions: false
Exclude:
- 'bin/**/*'
- 'vendor/**/*'
- 'node_modules/**/*'
- 'db/schema.rb'
- 'tmp/**/*'
- 'log/**/*'
- 'storage/**/*'
- 'spec/**/*'
- 'test/**/*'
# ============================================
# METRICS - Complexity and Size Limits
# ============================================
Metrics/BlockLength:
Exclude:
- 'config/routes.rb'
- 'config/routes/**/*'
- 'db/migrate/*'
- 'db/seeds.rb'
- 'spec/factories/**/*'
Max: 50
Metrics/MethodLength:
Max: 15
Exclude:
- 'db/migrate/*'
- 'app/**/services/*_service.rb' # Complex business logic services
- 'app/**/controllers/**/*_controller.rb' # Controllers with multiple actions (all nesting levels)
- 'app/**/jobs/*_job.rb' # Background jobs with sequential Riot API calls
- 'scripts/**/*' # Dev utility scripts
Metrics/ClassLength:
Max: 150
Exclude:
- 'app/**/services/*_service.rb' # Allow larger service classes
- 'app/**/controllers/**/*_controller.rb' # Controllers with many actions (all nesting levels)
- 'app/**/jobs/*_job.rb' # Background jobs with multiple helper methods
- 'config/initializers/**/*'
- 'scripts/**/*' # Dev utility scripts
Metrics/AbcSize:
Max: 20
Exclude:
- 'db/migrate/*'
- 'app/**/services/*_service.rb' # Complex business logic
- 'app/**/controllers/**/*_controller.rb' # Controller actions (all nesting levels)
- 'app/**/jobs/*_job.rb' # Background jobs
- 'scripts/**/*' # Dev utility scripts
Metrics/CyclomaticComplexity:
Max: 10
Metrics/PerceivedComplexity:
Max: 10
Metrics/ModuleLength:
Max: 150
Metrics/ParameterLists:
Max: 5
CountKeywordArgs: false
# ============================================
# NAMING - Conventions
# ============================================
# Disable predicate prefix checks (has_*, is_* are common in Rails)
Naming/PredicatePrefix:
Enabled: false
Naming/PredicateMethod:
Enabled: false # Disable predicate method naming (import_*, create_* are not predicates)
Naming/VariableNumber:
Enabled: false
# ============================================
# STYLE - Code Style
# ============================================
# Documentation required only for main code
Style/Documentation:
Enabled: true
Exclude:
- 'db/migrate/*'
- 'config/**/*'
- 'lib/tasks/**/*'
- 'app/controllers/concerns/**/*'
- 'app/models/concerns/**/*'
- 'app/channels/**/*'
- 'app/jobs/**/*'
- 'app/mailers/**/*'
Style/MultilineBlockChain:
Enabled: false
Style/SymbolProc:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
Exclude:
- 'db/schema.rb'
Style/FormatStringToken:
EnforcedStyle: template
Style/StringLiterals:
EnforcedStyle: single_quotes
Style/WordArray:
MinSize: 3
Style/FetchEnvVar:
Enabled: false
# ============================================
# LAYOUT - Formatting
# ============================================
Layout/LineLength:
Max: 120
Exclude:
- 'config/**/*'
- 'db/**/*'
Layout/EmptyLinesAroundBlockBody:
Enabled: true
Layout/EndOfLine:
EnforcedStyle: lf
# ============================================
# LINT - Code Quality
# ============================================
Lint/UnusedMethodArgument:
AllowUnusedKeywordArguments: true
IgnoreEmptyMethods: true
Lint/DuplicateBranch:
Enabled: true
# ============================================
# BUNDLER
# ============================================
Bundler/OrderedGems:
Enabled: false