Skip to content

Commit efb3e20

Browse files
committed
Merge remote-tracking branch 'upstream/main' into add-method-coverage-support
2 parents 3eff8b7 + 441d8ca commit efb3e20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2241
-1029
lines changed

.github/workflows/stable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
ruby: [2.5.8, 2.6.6, 2.7.1, jruby-9.2.11.1]
11+
ruby: [2.5.8, 2.6.6, 2.7.2, 3.0.0, jruby-9.2.14.0]
1212

1313
steps:
1414
- uses: actions/checkout@v2

.rubocop.yml

Lines changed: 103 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ AllCops:
1111
- "vendor/bundle/**/*"
1212
- "vendor/bundle/**/.*"
1313
TargetRubyVersion: 2.5
14+
# we might wanna adopt rspec and rake but it's a bit annoying for now
15+
SuggestExtensions: false
1416

1517
Bundler/OrderedGems:
1618
Description: Gems should be alphabetically sorted within groups.
@@ -43,11 +45,17 @@ Layout/SpaceAroundMethodCallOperator:
4345
Description: Checks method call operators to not have spaces around them.
4446
Enabled: true
4547

48+
Layout/SpaceBeforeBrackets:
49+
Enabled: true
50+
4651
Layout/SpaceInsideHashLiteralBraces:
4752
Description: Use spaces inside hash literal braces - or don't.
4853
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#spaces-operators
4954
EnforcedStyle: no_space
5055

56+
Lint/AmbiguousAssignment:
57+
Enabled: true
58+
5159
Lint/AmbiguousRegexpLiteral:
5260
Description: Checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
5361
Exclude:
@@ -58,46 +66,95 @@ Lint/AmbiguousRegexpLiteral:
5866
Lint/BinaryOperatorWithIdenticalOperands:
5967
Enabled: true
6068

69+
Lint/ConstantDefinitionInBlock:
70+
Exclude:
71+
- "spec/**/*_spec.rb"
72+
73+
Lint/DeprecatedConstants:
74+
Enabled: true
75+
6176
Lint/DeprecatedOpenSSLConstant:
6277
Description: Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`.
6378
Enabled: true
6479

80+
Lint/DuplicateBranch:
81+
Enabled: true
82+
6583
Lint/DuplicateElsifCondition:
6684
Enabled: true
6785

86+
Lint/DuplicateRegexpCharacterClassElement:
87+
Enabled: true
88+
6889
Lint/DuplicateRescueException:
6990
Enabled: true
7091

92+
Lint/EmptyBlock:
93+
Enabled: true
94+
95+
Lint/EmptyClass:
96+
Enabled: true
97+
7198
Lint/EmptyConditionalBody:
7299
Enabled: true
73100

74101
Lint/FloatComparison:
75102
Enabled: true
76103

104+
Lint/LambdaWithoutLiteralBlock:
105+
Enabled: true
106+
77107
Lint/MissingSuper:
78108
Enabled: true
79109

80110
Lint/MixedRegexpCaptureTypes:
81111
Description: Do not mix named captures and numbered captures in a Regexp literal.
82112
Enabled: true
83113

114+
Lint/NoReturnInBeginEndBlocks:
115+
Enabled: true
116+
117+
Lint/NumberedParameterAssignment:
118+
Enabled: true
119+
120+
Lint/OrAssignmentToConstant:
121+
Enabled: true
122+
84123
Lint/OutOfRangeRegexpRef:
85124
Enabled: true
86125

87126
Lint/RaiseException:
88127
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
89128
Enabled: true
90129

130+
Lint/RedundantDirGlobSort:
131+
Enabled: true
132+
91133
Lint/SelfAssignment:
92134
Enabled: true
93135

94136
Lint/StructNewOverride:
95137
Description: Disallow overriding the `Struct` built-in methods via `Struct.new`.
96138
Enabled: true
97139

140+
Lint/SymbolConversion:
141+
Enabled: true
142+
143+
Lint/ToEnumArguments:
144+
Enabled: true
145+
98146
Lint/TopLevelReturnWithArgument:
99147
Enabled: true
100148

149+
Lint/TripleQuotes:
150+
Enabled: true
151+
152+
Lint/UnexpectedBlockArity:
153+
Enabled: true
154+
155+
Lint/UnmodifiedReduceAccumulator:
156+
Enabled: true
157+
101158
Lint/UnreachableLoop:
102159
Enabled: true
103160

@@ -125,6 +182,7 @@ Metrics/MethodLength:
125182

126183
Metrics/ModuleLength:
127184
Description: Avoid modules longer than 100 lines of code.
185+
Max: 300
128186
Exclude:
129187
- "lib/simplecov.rb"
130188

@@ -140,16 +198,22 @@ Naming/FileName:
140198
- "spec/fixtures/utf-8.rb"
141199

142200
Style/AccessorGrouping:
143-
Enabled: true
201+
Enabled: true
202+
203+
Style/ArgumentsForwarding:
204+
Enabled: true
144205

145206
Style/ArrayCoercion:
146-
Enabled: true
207+
Enabled: true
147208

148209
Style/BisectedAttrAccessor:
149-
Enabled: true
210+
Enabled: true
150211

151212
Style/CaseLikeIf:
152-
Enabled: true
213+
Enabled: true
214+
215+
Style/CollectionCompact:
216+
Enabled: true
153217

154218
Style/CollectionMethods:
155219
Description: Enforces the use of consistent method names from the Enumerable module.
@@ -168,9 +232,15 @@ Style/DoubleNegation:
168232
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-bang-bang
169233
Enabled: false
170234

235+
Style/DocumentDynamicEvalDefinition:
236+
Enabled: true
237+
238+
Style/EndlessMethod:
239+
Enabled: true
240+
171241
Style/ExplicitBlockArgument:
172-
# capturing as a proc has a performance hit, so is a case by case choice
173-
Enabled: false
242+
# capturing as a proc has a performance hit, so is a case by case choice
243+
Enabled: false
174244

175245
Style/ExponentialNotation:
176246
Description: When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).
@@ -186,21 +256,24 @@ Style/FrozenStringLiteralComment:
186256
- "spec/fixtures/**/*"
187257

188258
Style/GlobalStdStream:
189-
Enabled: true
259+
Enabled: true
190260

191261
Style/GuardClause:
192262
Description: Use a guard clause instead of wrapping the code inside a conditional expression.
193263
Enabled: false
194264

195265
Style/HashAsLastArrayItem:
196-
Enabled: true
266+
Enabled: true
197267

198268
Style/HashEachMethods:
199269
Description: Use Hash#each_key and Hash#each_value.
200270
Enabled: true
201271

272+
Style/HashExcept:
273+
Enabled: true
274+
202275
Style/HashLikeCase:
203-
Enabled: true
276+
Enabled: true
204277

205278
Style/HashTransformKeys:
206279
Description: Prefer `transform_keys` over `each_with_object` and `map`.
@@ -214,17 +287,29 @@ Style/HashSyntax:
214287
Description: Checks hash literal syntax.
215288
EnforcedStyle: ruby19
216289

290+
Style/IfWithBooleanLiteralBranches:
291+
Enabled: true
292+
293+
Style/NegatedIfElseCondition:
294+
Enabled: true
295+
296+
Style/NilLambda:
297+
Enabled: true
298+
217299
Style/OptionalBooleanParameter:
218-
Enabled: true
300+
Enabled: true
301+
302+
Style/RedundantArgument:
303+
Enabled: true
219304

220305
Style/RedundantAssignment:
221-
Enabled: true
306+
Enabled: true
222307

223308
Style/RedundantFetchBlock:
224-
Enabled: true
309+
Enabled: true
225310

226311
Style/RedundantFileExtensionInRequire:
227-
Enabled: true
312+
Enabled: true
228313

229314
Style/RedundantRegexpCharacterClass:
230315
Description: Checks for unnecessary single-element Regexp character classes.
@@ -240,7 +325,7 @@ Style/RegexpLiteral:
240325
Enabled: false
241326

242327
Style/SingleArgumentDig:
243-
Enabled: true
328+
Enabled: true
244329

245330
Style/SlicingWithRange:
246331
Description: Checks array slicing is done with endless ranges when suitable.
@@ -254,12 +339,15 @@ Style/SpecialGlobalVars:
254339
- "lib/simplecov/defaults.rb"
255340

256341
Style/StringConcatenation:
257-
Enabled: true
342+
Enabled: true
258343

259344
Style/StringLiterals:
260345
Description: Allow double-quoted strings without interpolation.
261346
EnforcedStyle: double_quotes
262347

348+
Style/SwapValues:
349+
Enabled: true
350+
263351
Style/TrailingCommaInArrayLiteral:
264352
EnforcedStyleForMultiline: no_comma
265353

0 commit comments

Comments
 (0)