Skip to content

Commit 9e8e60d

Browse files
committed
Update rubocop config
1 parent aa512e3 commit 9e8e60d

File tree

2 files changed

+69
-43
lines changed

2 files changed

+69
-43
lines changed

.rubocop.yml

Lines changed: 67 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,102 @@
11
# this file is managed by rom-rb/devtools project
22

33
AllCops:
4-
TargetRubyVersion: 2.7
4+
NewCops: enable
5+
TargetRubyVersion: 3.1
56
Exclude:
67
- spec/support/coverage.rb
78
- spec/support/warnings.rb
89
- spec/support/rspec_options.rb
910
- Gemfile.devtools
1011
- "*.gemspec"
1112

12-
Layout/SpaceAroundMethodCallOperator:
13-
Enabled: false
14-
15-
Layout/SpaceInLambdaLiteral:
16-
Enabled: false
17-
18-
Layout/MultilineMethodCallIndentation:
19-
Enabled: true
20-
EnforcedStyle: indented
2113

2214
Layout/FirstArrayElementIndentation:
2315
EnforcedStyle: consistent
2416

25-
Layout/SpaceInsideHashLiteralBraces:
26-
Enabled: true
27-
EnforcedStyle: no_space
28-
EnforcedStyleForEmptyBraces: no_space
29-
3017
Layout/LineLength:
3118
Max: 100
3219
Exclude:
3320
- "spec/**/*_spec.rb"
3421

35-
Lint/BooleanSymbol:
22+
Layout/MultilineMethodCallIndentation:
23+
Enabled: true
24+
EnforcedStyle: indented
25+
26+
Layout/SpaceAroundMethodCallOperator:
3627
Enabled: false
3728

38-
Lint/RaiseException:
29+
Layout/SpaceInLambdaLiteral:
3930
Enabled: false
4031

41-
Lint/StructNewOverride:
32+
Layout/SpaceInsideHashLiteralBraces:
33+
Enabled: true
34+
EnforcedStyle: no_space
35+
EnforcedStyleForEmptyBraces: no_space
36+
37+
Lint/BooleanSymbol:
4238
Enabled: false
4339

44-
Lint/SuppressedException:
40+
Lint/ConstantDefinitionInBlock:
4541
Exclude:
46-
- "spec/spec_helper.rb"
42+
- "spec/**/*.rb"
4743

48-
Naming/PredicateName:
49-
Enabled: false
44+
Lint/EmptyBlock:
45+
Exclude:
46+
- "spec/**/*.rb"
5047

51-
Naming/FileName:
48+
Lint/EmptyClass:
5249
Exclude:
53-
- "lib/*-*.rb"
50+
- "spec/**/*.rb"
5451

55-
Naming/MethodName:
52+
Lint/RaiseException:
5653
Enabled: false
5754

58-
Naming/MemoizedInstanceVariableName:
55+
Lint/StructNewOverride:
5956
Enabled: false
6057

61-
Metrics/MethodLength:
62-
Enabled: false
58+
Lint/SuppressedException:
59+
Exclude:
60+
- "spec/spec_helper.rb"
6361

64-
Metrics/ClassLength:
65-
Enabled: false
62+
Metrics/AbcSize:
63+
Max: 20
6664

6765
Metrics/BlockLength:
6866
Enabled: false
6967

70-
Metrics/AbcSize:
71-
Max: 25
68+
Metrics/ClassLength:
69+
Max: 150
7270

7371
Metrics/CyclomaticComplexity:
7472
Enabled: true
75-
Max: 12
73+
Max: 10
7674

77-
Style/ExponentialNotation:
75+
Metrics/MethodLength:
76+
Max: 22
77+
78+
Naming/FileName:
79+
Exclude:
80+
- "lib/*-*.rb"
81+
82+
Naming/MemoizedInstanceVariableName:
7883
Enabled: false
7984

80-
Style/HashEachMethods:
85+
Naming/MethodName:
8186
Enabled: false
8287

83-
Style/HashTransformKeys:
88+
Naming/MethodParameterName:
8489
Enabled: false
8590

86-
Style/HashTransformValues:
91+
Naming/PredicateName:
8792
Enabled: false
8893

8994
Style/AccessModifierDeclarations:
9095
Enabled: false
9196

97+
Style/AccessorGrouping:
98+
EnforcedStyle: separated
99+
92100
Style/Alias:
93101
Enabled: true
94102
EnforcedStyle: prefer_alias_method
@@ -115,12 +123,27 @@ Style/Documentation:
115123
Style/EachWithObject:
116124
Enabled: false
117125

126+
Style/ExponentialNotation:
127+
Enabled: false
128+
118129
Style/FormatString:
119130
Enabled: false
120131

121132
Style/GuardClause:
122133
Enabled: false
123134

135+
Style/HashAsLastArrayItem:
136+
EnforcedStyle: no_braces
137+
138+
Style/HashEachMethods:
139+
Enabled: false
140+
141+
Style/HashTransformKeys:
142+
Enabled: false
143+
144+
Style/HashTransformValues:
145+
Enabled: false
146+
124147
Style/IfUnlessModifier:
125148
Enabled: false
126149

@@ -130,6 +153,12 @@ Style/Lambda:
130153
Style/LambdaCall:
131154
Enabled: false
132155

156+
Style/MultipleComparison:
157+
Enabled: false
158+
159+
Style/NumberedParametersLimit:
160+
Max: 2
161+
133162
Style/ParallelAssignment:
134163
Enabled: false
135164

@@ -138,7 +167,7 @@ Style/StabbyLambdaParentheses:
138167

139168
Style/StringLiterals:
140169
Enabled: true
141-
EnforcedStyle: double_quotes
170+
EnforcedStyle: single_quotes
142171
ConsistentQuotesInMultiline: false
143172

144173
Style/StringLiteralsInInterpolation:
@@ -151,6 +180,3 @@ Style/SymbolArray:
151180

152181
Style/TrailingUnderscoreVariable:
153182
Enabled: false
154-
155-
Style/MultipleComparison:
156-
Enabled: false

Gemfile.devtools

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ group :test do
99
gem "simplecov-cobertura", require: false, platforms: :ruby
1010
gem "rexml", require: false
1111

12-
gem "warning" if RUBY_VERSION >= "2.4.0"
12+
gem "warning"
1313
end
1414

1515
group :tools do
1616
# this is the same version that we use on codacy
17-
gem "rubocop", "0.82.0"
17+
gem "rubocop", "1.69.2"
1818
end

0 commit comments

Comments
 (0)