Skip to content

Commit 4379451

Browse files
committed
Upgrade RuboCop to the latest version
1 parent 17e20b6 commit 4379451

20 files changed

Lines changed: 354 additions & 124 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
- name: Set up Ruby
111111
uses: ruby/setup-ruby@v1
112112
with:
113-
ruby-version: 2.7
113+
ruby-version: 3.0
114114
- name: Cache gems
115115
uses: actions/cache@v2
116116
with:

.rubocop.yml

Lines changed: 125 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,87 @@ AllCops:
99
- 'vendor/bundle/**/*'
1010
TargetRubyVersion: 2.5
1111

12+
Gemspec/DateAssignment:
13+
Enabled: true
14+
1215
Layout/AccessModifierIndentation:
1316
EnforcedStyle: outdent
1417

1518
Layout/DotPosition:
1619
EnforcedStyle: trailing
1720

21+
Layout/LineEndStringConcatenationIndentation:
22+
Enabled: true
23+
24+
Layout/LineLength:
25+
AllowURI: true
26+
Enabled: false
27+
28+
Layout/SpaceBeforeBrackets:
29+
Enabled: true
30+
1831
Layout/SpaceInsideHashLiteralBraces:
1932
EnforcedStyle: no_space
2033

34+
Lint/AmbiguousAssignment:
35+
Enabled: true
36+
37+
Lint/AmbiguousRange:
38+
Enabled: true
39+
40+
Lint/DeprecatedConstants:
41+
Enabled: true
42+
43+
Lint/DuplicateBranch:
44+
Enabled: true
45+
IgnoreLiteralBranches: true
46+
47+
Lint/DuplicateRegexpCharacterClassElement:
48+
Enabled: true
49+
50+
Lint/EmptyBlock:
51+
Enabled: true
52+
Exclude:
53+
- 'spec/**/*'
54+
55+
Lint/EmptyClass:
56+
Enabled: true
57+
Exclude:
58+
- 'spec/**/*'
59+
60+
Lint/EmptyInPattern:
61+
Enabled: true
62+
63+
Lint/LambdaWithoutLiteralBlock:
64+
Enabled: true
65+
66+
Lint/NoReturnInBeginEndBlocks:
67+
Enabled: true
68+
69+
Lint/NumberedParameterAssignment:
70+
Enabled: true
71+
72+
Lint/OrAssignmentToConstant:
73+
Enabled: true
74+
75+
Lint/RedundantDirGlobSort:
76+
Enabled: true
77+
78+
Lint/SymbolConversion:
79+
Enabled: true
80+
81+
Lint/ToEnumArguments:
82+
Enabled: true
83+
84+
Lint/TripleQuotes:
85+
Enabled: true
86+
87+
Lint/UnexpectedBlockArity:
88+
Enabled: true
89+
90+
Lint/UnmodifiedReduceAccumulator:
91+
Enabled: true
92+
2193
Metrics/AbcSize:
2294
Max: 69.98 # TODO: Lower to 15
2395

@@ -29,11 +101,7 @@ Metrics/ClassLength:
29101
Max: 120 # TODO: Lower to 100
30102

31103
Metrics/CyclomaticComplexity:
32-
Max: 12 # TODO: Lower to 6
33-
34-
Metrics/LineLength:
35-
AllowURI: true
36-
Enabled: false
104+
Max: 15 # TODO: Lower to 6
37105

38106
Metrics/MethodLength:
39107
CountComments: false
@@ -47,15 +115,24 @@ Metrics/ParameterLists:
47115
CountKeywordArgs: true
48116

49117
Metrics/PerceivedComplexity:
50-
Max: 14 # TODO: Lower to 7
118+
Max: 17 # TODO: Lower to 7
51119

52120
Naming/FileName:
53121
Exclude:
54122
- 'lib/rails_admin/bootstrap-sass.rb'
55123

124+
Naming/InclusiveLanguage:
125+
Enabled: true
126+
56127
Style/Alias:
57128
Enabled: false
58129

130+
Style/ArgumentsForwarding:
131+
Enabled: true
132+
133+
Style/CollectionCompact:
134+
Enabled: true
135+
59136
Style/CollectionMethods:
60137
PreferredMethods:
61138
map: 'collect'
@@ -66,6 +143,9 @@ Style/CollectionMethods:
66143
Style/Documentation:
67144
Enabled: false
68145

146+
Style/DocumentDynamicEvalDefinition:
147+
Enabled: false
148+
69149
Style/DoubleNegation:
70150
Enabled: false
71151

@@ -75,18 +155,57 @@ Style/EachWithObject:
75155
Style/Encoding:
76156
Enabled: false
77157

158+
Style/EndlessMethod:
159+
Enabled: true
160+
78161
Style/FrozenStringLiteralComment:
79162
Enabled: false
80163

164+
Style/HashConversion:
165+
Enabled: true
166+
167+
Style/HashExcept:
168+
Enabled: true
169+
170+
Style/IfWithBooleanLiteralBranches:
171+
Enabled: true
172+
173+
Style/InPatternThen:
174+
Enabled: true
175+
81176
Style/Lambda:
82177
Enabled: false
83178

179+
Style/MultilineInPatternThen:
180+
Enabled: true
181+
182+
Style/NegatedIfElseCondition:
183+
Enabled: true
184+
84185
Style/NumericPredicate:
85186
Enabled: false
86187

188+
Style/NilLambda:
189+
Enabled: true
190+
191+
Style/QuotedSymbols:
192+
Enabled: true
193+
87194
Style/RaiseArgs:
88195
EnforcedStyle: compact
89196

197+
Style/RedundantArgument:
198+
Enabled: true
199+
200+
Style/RedundantSelfAssignmentBranch:
201+
Enabled: true
202+
203+
Style/StringChars:
204+
Enabled: true
205+
206+
Style/SwapValues:
207+
Enabled: true
208+
90209
Style/TrailingCommaInArguments:
91210
EnforcedStyleForMultiline: 'comma'
92211

0 commit comments

Comments
 (0)