-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.rubocop.yml
More file actions
137 lines (105 loc) · 2.74 KB
/
Copy path.rubocop.yml
File metadata and controls
137 lines (105 loc) · 2.74 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
# frozen_string_literal: true
require:
- rubocop-minitest
- rubocop-performance
AllCops:
TargetRubyVersion: 3.2
NewCops: enable
Exclude:
- 'bin/**/*'
- 'vendor/**/*'
- 'test/dummy/**/*'
- 'db/migrate/**/*' # Generated migrations
- 'lib/generators/**/templates/**/*' # Generator templates
# Layout & Formatting
Layout/LineLength:
Max: 120
AllowedPatterns:
- '\s*#.*' # Allow long comments
- '^\s*raise\s' # Allow long raise statements
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/ArgumentAlignment:
EnforcedStyle: with_first_argument
Layout/FirstArgumentIndentation:
EnforcedStyle: consistent
# Style
Style/Documentation:
Enabled: false # Don't require class documentation for now
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
Style/ClassAndModuleChildren:
EnforcedStyle: compact
Style/GuardClause:
MinBodyLength: 3
# Metrics
Metrics/ClassLength:
Max: 150
Metrics/ModuleLength:
Max: 150
Metrics/MethodLength:
Max: 25
AllowedMethods:
- 'configure' # Configuration blocks can be longer
Metrics/BlockLength:
Max: 25
AllowedMethods:
- 'configure'
- 'describe'
- 'context'
- 'it'
- 'test'
Exclude:
- 'test/**/*' # Allow long test blocks
Metrics/AbcSize:
Max: 20
AllowedMethods:
- 'configure'
Metrics/CyclomaticComplexity:
Max: 8
Metrics/PerceivedComplexity:
Max: 10
# Naming
Naming/PredicateName:
ForbiddenPrefixes:
- 'is_'
AllowedMethods:
- 'is_a?'
# Performance
Performance/StringReplacement:
Enabled: true
Performance/RedundantMerge:
Enabled: true
# Minitest
Minitest/MultipleAssertions:
Enabled: false # Allow multiple assertions in integration tests
Minitest/AssertTruthy:
Enabled: false # Allow assert instead of assert_equal true
# Rails-specific (even though we don't have full Rails)
Style/Rails/HttpStatus:
Enabled: false
# Custom overrides for this gem
Style/AccessorGrouping:
Enabled: false # Allow separate attr_reader/attr_writer
Style/MutableConstant:
Enabled: false # We have some intentionally mutable constants
# Allow class variables for registry pattern
Style/ClassVars:
Enabled: false
# Allow metaprogramming patterns common in Rails engines
Style/EvalWithLocation:
Enabled: false
Lint/MissingSuper:
Enabled: false # Allow classes that don't call super
# Disable some cops that don't work well with our DSL
Style/MethodCallWithoutArgsParentheses:
Enabled: false # Our DSL looks better without parens
# Thread safety
Style/GlobalVars:
AllowedVariables: ['$0'] # Only allow program name
# Database-related
Style/NumericLiterals:
Enabled: false # Allow raw numbers in database IDs/amounts