kpn-style 0.1.9 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96d6e50ff69646204b8dedff7ddf181158f6e1a0723ee8531c6b02b7db6609ae
4
- data.tar.gz: 9f2bb4039eddbc70c4f4ec742079d4467d7ac39ae769e7447b9e3df7ea8485b2
3
+ metadata.gz: be663111c2ddf1da54c8e07cab757e6b18a4b373b9acc79da4fdeafc1395f835
4
+ data.tar.gz: 06fb35dd9a4953b80632144b8c674fc320ae1855c4119d741be599b150f4a403
5
5
  SHA512:
6
- metadata.gz: babc8209373da24d0fc904ef850741d4b65a1117986a48164f04fa8f932d84b3b1d6c4f3cc6c13619573f5317dc426653a2898dd3a18e9b6005bf9cb31258407
7
- data.tar.gz: efda82a642113806f5ffa23a17742fff02cea4c6772103931f11a292d663834e007fe719f66f59192c929cefa12d200944953ca9856ddea944d6163a2aec8af5
6
+ metadata.gz: 27eb24ab5e6695fa1af4439957ef2390c13e112637ad27934425de7d0516bfdb2be8be4a76ee590c5635fac28436b627777fdb0d803c896fea26cb8eff1aca55
7
+ data.tar.gz: ad3912f4e8cdd4abda944cba746a4c2d3fc9ee2d81b0f4bc5a49d63aa0e00e04d0208987f2b340678203eab78f40352d8f5ef61680e9829961223cfc19589387
data/README.md CHANGED
@@ -58,6 +58,13 @@ inherit_gem:
58
58
  - ruby-2.7.yml
59
59
  ```
60
60
 
61
+ Or for Ruby 3.0:
62
+
63
+ ```yaml
64
+ inherit_gem:
65
+ kpn-style:
66
+ - ruby-3.0.yml
67
+ ```
61
68
  Now, run:
62
69
 
63
70
  ```bash
data/kpn_style.gemspec CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'kpn-style'
6
- spec.version = '0.1.9'
6
+ spec.version = '0.2.0'
7
7
  spec.authors = ['kpn']
8
8
  spec.email = ['noreply@kpn.com']
9
9
 
@@ -1,3 +1,3 @@
1
1
  module Kpn::Style
2
- VERSION = '0.1.9'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
data/ruby-3.0.yml ADDED
@@ -0,0 +1,737 @@
1
+ ---
2
+ require: rubocop-rspec
3
+ AllCops:
4
+ DisplayCopNames: true
5
+ TargetRubyVersion: '3.0'
6
+ Include:
7
+ - "**/*.rb"
8
+ Exclude:
9
+ - bin/*
10
+ - ".vendor/**/*"
11
+ - Gemfile
12
+ - Rakefile
13
+ - pkg/**/*
14
+ - spec/fixtures/**/*
15
+ - vendor/**/*
16
+
17
+ Capybara/ClickLinkOrButtonStyle:
18
+ Description: Checks for methods of button or link clicks.
19
+ Enabled: true
20
+ Capybara/MatchStyle:
21
+ Description: Checks for usage of deprecated style methods.
22
+ Enabled: true
23
+ Capybara/RedundantWithinFind:
24
+ Description: Checks for redundant `within find(...)` calls.
25
+ Enabled: true
26
+ Capybara/RSpec/HaveSelector:
27
+ Description: Use `have_css` or `have_xpath` instead of `have_selector`.
28
+ Enabled: true
29
+ Capybara/RSpec/PredicateMatcher:
30
+ Description: Prefer using predicate matcher over using predicate method directly.
31
+ Enabled: true
32
+ FactoryBot/AssociationStyle:
33
+ Description: Use a consistent style to define associations.
34
+ Enabled: true
35
+ FactoryBot/ExcessiveCreateList:
36
+ Description: Check for excessive model creation in a list.
37
+ Enabled: true
38
+ FactoryBot/FactoryAssociationWithStrategy:
39
+ Description: Use definition in factory association instead of hard coding a strategy.
40
+ Enabled: true
41
+ FactoryBot/FactoryNameStyle:
42
+ Description: Checks for name style for argument of FactoryBot::Syntax::Methods.
43
+ Enabled: true
44
+ FactoryBot/IdSequence:
45
+ Description: Do not create a FactoryBot sequence for an id column.
46
+ Enabled: true
47
+ FactoryBot/RedundantFactoryOption:
48
+ Description: Checks for redundant `factory` option.
49
+ Enabled: true
50
+ Gemspec/DevelopmentDependencies:
51
+ Description: 'Checks that development dependencies are specified in Gemfile rather than gemspec.'
52
+ Enabled: true
53
+ Gemspec/DeprecatedAttributeAssignment:
54
+ Description: 'Checks that deprecated attribute assignments are not set in a gemspec file.'
55
+ Enabled: true
56
+ Gemspec/RequireMFA:
57
+ Description: 'Checks that the gemspec has metadata to require Multi-Factor Authentication from RubyGems.'
58
+ Enabled: true
59
+ Layout/LineLength:
60
+ Description: People have wide screens, use them.
61
+ Max: 240
62
+ Layout/LineContinuationLeadingSpace:
63
+ Description: >-
64
+ Use trailing spaces instead of leading spaces in strings
65
+ broken over multiple lines (by a backslash).
66
+ Enabled: true
67
+ Layout/LineContinuationSpacing:
68
+ Description: 'Checks the spacing in front of backslash in line continuations.'
69
+ Enabled: true
70
+ Layout/LineEndStringConcatenationIndentation:
71
+ Description: >-
72
+ Checks the indentation of the next line after a line that
73
+ ends with a string literal and a backslash.
74
+ Enabled: true
75
+ Layout/SpaceBeforeBrackets:
76
+ Description: 'Checks for receiver with a space before the opening brackets.'
77
+ Enabled: true
78
+ RSpec/BeEmpty:
79
+ Description: Prefer using `be_empty` when checking for an empty array.
80
+ Enabled: true
81
+ RSpec/BeforeAfterAll:
82
+ Description: Beware of using after(:all) as it may cause state to leak between tests.
83
+ A necessary evil in acceptance testing.
84
+ Exclude:
85
+ - spec/acceptance/**/*.rb
86
+ RSpec/ContainExactly:
87
+ Description: Checks where `contain_exactly` is used.
88
+ Enabled: true
89
+ RSpec/DuplicatedMetadata:
90
+ Description: Avoid duplicated metadata.
91
+ Enabled: true
92
+ RSpec/EmptyExampleGroup:
93
+ Description: Checks if an example group does not include any tests.
94
+ Enabled: false
95
+ RSpec/EmptyMetadata:
96
+ Description: Avoid empty metadata hash.
97
+ Enabled: true
98
+ RSpec/Eq:
99
+ Description: Use `eq` instead of `be ==` to compare objects.
100
+ Enabled: true
101
+ RSpec/IndexedLet:
102
+ Description: Do not set up test data using indexes (e.g., `item_1`, `item_2`).
103
+ Enabled: true
104
+ RSpec/HookArgument:
105
+ Description: Prefer explicit :each argument, matching existing module's style
106
+ EnforcedStyle: each
107
+ RSpec/MatchArray:
108
+ Description: Checks where `match_array` is used.
109
+ Enabled: true
110
+ RSpec/MetadataStyle:
111
+ Description: Use consistent metadata style.
112
+ Enabled: true
113
+ RSpec/PendingWithoutReason:
114
+ PendingWithoutReason:
115
+ Description: Checks for pending or skipped examples without reason.
116
+ Enabled: true
117
+ RSpec/ReceiveMessages:
118
+ Description: Checks for multiple messages stubbed on the same object.
119
+ Enabled: true
120
+ RSpec/RedundantAround:
121
+ Description: Remove redundant `around` hook.
122
+ Enabled: true
123
+ RSpec/RedundantPredicateMatcher:
124
+ Description: Checks for redundant predicate matcher.
125
+ Enabled: true
126
+ RSpec/RemoveConst:
127
+ Description: Checks that `remove_const` is not used in specs.
128
+ Enabled: true
129
+ RSpec/RepeatedDescription:
130
+ Description: Check for repeated description strings in example groups.
131
+ Enabled: false
132
+ RSpec/SkipBlockInsideExample:
133
+ Description: Checks for passing a block to `skip` within examples.
134
+ Enabled: true
135
+ RSpec/SpecFilePathFormat:
136
+ Description: Checks that spec file paths are consistent and well-formed.
137
+ Enabled: true
138
+ RSpec/SpecFilePathSuffix:
139
+ Description: Checks that spec file paths suffix are consistent and well-formed.
140
+ Enabled: true
141
+ RSpec/Rails/MinitestAssertions:
142
+ Description: Check if using Minitest matchers.
143
+ Enabled: true
144
+ RSpec/Rails/NegationBeValid:
145
+ Description: Enforces use of `be_invalid` or `not_to` for negated be_valid.
146
+ Enabled: true
147
+ RSpec/Rails/TravelAround:
148
+ Description: Prefer to travel in `before` rather than `around`.
149
+ Enabled: true
150
+ Style/BlockDelimiters:
151
+ Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then.
152
+ EnforcedStyle: braces_for_chaining
153
+ Style/ClassAndModuleChildren:
154
+ Description: Compact style reduces the required amount of indentation.
155
+ EnforcedStyle: compact
156
+ Style/EmptyElse:
157
+ Description: Enforce against empty else clauses, but allow `nil` for clarity.
158
+ EnforcedStyle: empty
159
+ Style/FormatString:
160
+ Description: Following the main puppet project's style, prefer the % format format.
161
+ EnforcedStyle: percent
162
+ Style/FormatStringToken:
163
+ Description: Following the main puppet project's style, prefer the simpler template
164
+ tokens over annotated ones.
165
+ EnforcedStyle: template
166
+ Style/Lambda:
167
+ Description: Prefer the keyword for easier discoverability.
168
+ EnforcedStyle: literal
169
+ Style/RegexpLiteral:
170
+ Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
171
+ EnforcedStyle: percent_r
172
+ Style/TernaryParentheses:
173
+ Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
174
+ on complex expressions for better readability, but seriously consider breaking
175
+ it up.
176
+ EnforcedStyle: require_parentheses_when_complex
177
+ Style/TrailingCommaInArguments:
178
+ Description: Prefer always trailing comma on multiline argument lists. This makes
179
+ diffs, and re-ordering nicer.
180
+ EnforcedStyleForMultiline: comma
181
+ Style/TrailingCommaInArrayLiteral:
182
+ EnforcedStyleForMultiline: comma
183
+ Style/TrailingCommaInHashLiteral:
184
+ EnforcedStyleForMultiline: comma
185
+ Style/SymbolArray:
186
+ Description: Using percent style obscures symbolic intent of array's contents.
187
+ EnforcedStyle: brackets
188
+ RSpec/MessageSpies:
189
+ Description: Checks that message expectations are set using spies.
190
+ EnforcedStyle: receive
191
+ Style/CollectionMethods:
192
+ Description: Preferred collection methods.
193
+ Enabled: true
194
+ Style/MethodCalledOnDoEndBlock:
195
+ Description: Avoid chaining a method call on a do...end block.
196
+ Enabled: true
197
+ Style/StringMethods:
198
+ Description: Checks if configured preferred methods are used over non-preferred.
199
+ Enabled: true
200
+ Layout/EndOfLine:
201
+ Description: Use Unix-style line endings.
202
+ EnforcedStyle: lf
203
+ Metrics/AbcSize:
204
+ Description: >-
205
+ A calculated magnitude based on number of assignments,
206
+ branches, and conditions.
207
+ Enabled: false
208
+ Metrics/BlockLength:
209
+ Description: Avoid long blocks with many lines.
210
+ Enabled: false
211
+ Metrics/ClassLength:
212
+ Description: Avoid classes longer than 100 lines of code.
213
+ Enabled: false
214
+ Metrics/CollectionLiteralLength:
215
+ Description: 'Checks for `Array` or `Hash` literals with many entries.'
216
+ Enabled: true
217
+ Metrics/CyclomaticComplexity:
218
+ Description: >-
219
+ A complexity metric that is strongly correlated to the number
220
+ of test cases needed to validate a method.
221
+ Enabled: false
222
+ Metrics/MethodLength:
223
+ Description: Avoid methods longer than 10 lines of code.
224
+ Enabled: false
225
+ Metrics/ModuleLength:
226
+ Description: Avoid modules longer than 100 lines of code.
227
+ Enabled: false
228
+ Metrics/ParameterLists:
229
+ Description: Avoid parameter lists longer than three or four parameters.
230
+ Enabled: false
231
+ Metrics/PerceivedComplexity:
232
+ Description: >-
233
+ A complexity metric geared towards measuring complexity for a
234
+ human reader.
235
+ Enabled: false
236
+ RSpec/DescribeClass:
237
+ Description: Check that the first argument to the top-level describe is a constant.
238
+ Enabled: false
239
+ RSpec/ExampleLength:
240
+ Description: Checks for long examples.
241
+ Enabled: false
242
+ RSpec/MessageExpectation:
243
+ Description: Checks for consistent message expectation style.
244
+ Enabled: false
245
+ RSpec/MultipleExpectations:
246
+ Description: Checks if examples contain too many `expect` calls.
247
+ Enabled: false
248
+ RSpec/NestedGroups:
249
+ Description: Checks for nested example groups.
250
+ Enabled: false
251
+ Style/AsciiComments:
252
+ Description: Use only ascii symbols in comments.
253
+ Enabled: false
254
+ Style/IfUnlessModifier:
255
+ Description: Don't force trailing if/unless for single-line conditionals
256
+ Enabled: false
257
+ Style/SymbolProc:
258
+ Description: Use symbols as procs instead of blocks when possible.
259
+ Enabled: false
260
+ Layout/EmptyLinesAroundAttributeAccessor:
261
+ Description: Keep blank lines around attribute accessors.
262
+ Enabled: true
263
+ Layout/SpaceAroundMethodCallOperator:
264
+ Description: Checks method call operators to not have spaces around them.
265
+ Enabled: true
266
+ Lint/AmbiguousAssignment:
267
+ Description: 'Checks for mistyped shorthand assignments.'
268
+ Enabled: true
269
+ Lint/AmbiguousOperatorPrecedence:
270
+ Description: >-
271
+ Checks for expressions containing multiple binary operations with
272
+ ambiguous precedence.
273
+ Enabled: true
274
+ Lint/AmbiguousRange:
275
+ Description: 'Checks for ranges with ambiguous boundaries.'
276
+ Enabled: true
277
+ Lint/ConstantOverwrittenInRescue:
278
+ Description: 'Checks for overwriting an exception with an exception result by use `rescue =>`.'
279
+ Enabled: true
280
+ Lint/DeprecatedConstants:
281
+ Description: 'Checks for deprecated constants.'
282
+ Enabled: true
283
+ Lint/DuplicateBranch:
284
+ Description: 'Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.'
285
+ Enabled: true
286
+ Lint/DuplicateMagicComment:
287
+ Description: 'Check for duplicated magic comments.'
288
+ Enabled: true
289
+ Lint/DuplicateMatchPattern:
290
+ Description: 'Do not repeat patterns in `in` keywords.'
291
+ Enabled: true
292
+ Lint/DuplicateRegexpCharacterClassElement:
293
+ Description: 'Checks for duplicate elements in Regexp character classes.'
294
+ Enabled: true
295
+ Lint/EmptyBlock:
296
+ Description: 'Checks for blocks without a body.'
297
+ Enabled: true
298
+ Lint/EmptyClass:
299
+ Description: 'Checks for classes and metaclasses without a body.'
300
+ Enabled: true
301
+ Lint/EmptyInPattern:
302
+ Description: 'Checks for the presence of `in` pattern branches without a body.'
303
+ Enabled: true
304
+ Lint/IncompatibleIoSelectWithFiberScheduler:
305
+ Description: 'Checks for `IO.select` that is incompatible with Fiber Scheduler.'
306
+ Enabled: true
307
+ Lint/ItWithoutArgumentsInBlock:
308
+ Description: 'Checks uses of `it` calls without arguments in block.'
309
+ Enabled: true
310
+ Lint/LambdaWithoutLiteralBlock:
311
+ Description: 'Checks uses of lambda without a literal block.'
312
+ Enabled: true
313
+ Lint/LiteralAssignmentInCondition:
314
+ Description: 'Checks for literal assignments in the conditions.'
315
+ Enabled: true
316
+ Lint/MixedCaseRange:
317
+ Description: 'Checks for mixed-case character ranges since they include likely unintended characters.'
318
+ Enabled: true
319
+ Lint/NoReturnInBeginEndBlocks:
320
+ Description: 'Do not `return` inside `begin..end` blocks in assignment contexts.'
321
+ Enabled: true
322
+ Lint/NonAtomicFileOperation:
323
+ Description: 'Checks for non-atomic file operations.'
324
+ Enabled: true
325
+ Lint/NumberedParameterAssignment:
326
+ Description: 'Checks for uses of numbered parameter assignment.'
327
+ Enabled: true
328
+ Lint/OrAssignmentToConstant:
329
+ Description: 'Checks unintended or-assignment to constant.'
330
+ Enabled: true
331
+ Lint/RedundantDirGlobSort:
332
+ Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.'
333
+ Enabled: true
334
+ Lint/RedundantRegexpQuantifiers:
335
+ Description: 'Checks for redundant quantifiers in Regexps.'
336
+ Enabled: true
337
+ Lint/RefinementImportMethods:
338
+ Description: 'Use `Refinement#import_methods` when using `include` or `prepend` in `refine` block.'
339
+ Enabled: true
340
+ Lint/RequireRangeParentheses:
341
+ Description: 'Checks that a range literal is enclosed in parentheses when the end of the range is at a line break.'
342
+ Enabled: true
343
+ Lint/RequireRelativeSelfPath:
344
+ Description: 'Checks for uses a file requiring itself with `require_relative`.'
345
+ Enabled: true
346
+ Lint/SymbolConversion:
347
+ Description: 'Checks for unnecessary symbol conversions.'
348
+ Enabled: true
349
+ Lint/ToEnumArguments:
350
+ Description: 'Ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
351
+ Enabled: true
352
+ Lint/TripleQuotes:
353
+ Description: 'Checks for useless triple quote constructs.'
354
+ Enabled: true
355
+ Lint/UnexpectedBlockArity:
356
+ Description: 'Looks for blocks that have fewer arguments that the calling method expects.'
357
+ Enabled: true
358
+ Lint/UnmodifiedReduceAccumulator:
359
+ Description: 'Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.'
360
+ Enabled: true
361
+ Lint/UselessRescue:
362
+ Description: 'Checks for useless `rescue`s.'
363
+ Enabled: true
364
+ Lint/UselessRuby2Keywords:
365
+ Description: 'Finds unnecessary uses of `ruby2_keywords`.'
366
+ Enabled: true
367
+ Lint/BinaryOperatorWithIdenticalOperands:
368
+ Description: This cop checks for places where binary operator has identical operands.
369
+ Enabled: true
370
+ Lint/DeprecatedOpenSSLConstant:
371
+ Description: Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`.
372
+ Enabled: true
373
+ Lint/DuplicateElsifCondition:
374
+ Description: Do not repeat conditions used in if `elsif`.
375
+ Enabled: true
376
+ Lint/DuplicateRescueException:
377
+ Description: Checks that there are no repeated exceptions used in `rescue` expressions.
378
+ Enabled: true
379
+ Lint/EmptyConditionalBody:
380
+ Description: This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.
381
+ Enabled: true
382
+ Lint/FloatComparison:
383
+ Description: Checks for the presence of precise comparison of floating point numbers.
384
+ Enabled: true
385
+ Lint/MissingSuper:
386
+ Description: >-
387
+ This cop checks for the presence of constructors and lifecycle callbacks
388
+ without calls to `super`'.
389
+ Enabled: true
390
+ Lint/MixedRegexpCaptureTypes:
391
+ Description: Do not mix named captures and numbered captures in a Regexp literal.
392
+ Enabled: true
393
+ Lint/OutOfRangeRegexpRef:
394
+ Description: Checks for out of range reference for Regexp because it always returns nil.
395
+ Enabled: true
396
+ Lint/RaiseException:
397
+ Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
398
+ Enabled: true
399
+ Lint/SelfAssignment:
400
+ Description: Checks for self-assignments.
401
+ Enabled: true
402
+ Lint/StructNewOverride:
403
+ Description: Disallow overriding the `Struct` built-in methods via `Struct.new`.
404
+ Enabled: true
405
+ Lint/TopLevelReturnWithArgument:
406
+ Description: This cop detects top level return statements with argument.
407
+ Enabled: true
408
+ Lint/UnreachableLoop:
409
+ Description: This cop checks for loops that will have at most one iteration.
410
+ Enabled: true
411
+ Naming/BlockForwarding:
412
+ Description: 'Use anonymous block forwarding.'
413
+ Enabled: true
414
+ RSpec/BeEq: #
415
+ Description: 'Check for expectations where `be(...)` can replace `eq(...)`.'
416
+ Enabled: true
417
+ RSpec/BeNil: #
418
+ Description: 'Ensures a consistent style is used when matching `nil`.'
419
+ Enabled: true
420
+ RSpec/ChangeByZero:
421
+ Description: 'Prefer negated matchers over `to change.by(0)`.'
422
+ Enabled: true
423
+ RSpec/ClassCheck:
424
+ Description: 'Enforces consistent use of `be_a` or `be_kind_of`.'
425
+ Enabled: true
426
+ RSpec/ExcessiveDocstringSpacing:
427
+ Description: 'Checks for excessive whitespace in example descriptions.'
428
+ Enabled: true
429
+ RSpec/IdenticalEqualityAssertion:
430
+ Description: 'Checks for equality assertions with identical expressions on both sides.'
431
+ Enabled: true
432
+ RSpec/NoExpectationExample:
433
+ Description: 'Checks if an example contains any expectation.'
434
+ Enabled: false
435
+ RSpec/SortMetadata:
436
+ Description: 'Sort RSpec metadata alphabetically.'
437
+ Enabled: true
438
+ RSpec/SubjectDeclaration:
439
+ Description: 'Ensure that subject is defined using subject helper.'
440
+ Enabled: true
441
+ RSpec/VerifiedDoubleReference:
442
+ Description: 'Checks for consistent verified double reference style.'
443
+ Enabled: true
444
+ RSpec/Capybara/NegationMatcher:
445
+ Description: 'Enforces use of `have_no_*` or `not_to` for negated expectations.'
446
+ Enabled: true
447
+ RSpec/Capybara/SpecificActions:
448
+ Description: 'Checks for there is a more specific actions offered by Capybara.'
449
+ Enabled: true
450
+ RSpec/Capybara/SpecificFinders:
451
+ Description: 'Checks if there is a more specific finder offered by Capybara.'
452
+ Enabled: true
453
+ RSpec/Capybara/SpecificMatcher:
454
+ Description: 'Checks for there is a more specific matcher offered by Capybara.'
455
+ Enabled: true
456
+ RSpec/FactoryBot/ConsistentParenthesesStyle:
457
+ Description: 'Use a consistent style for parentheses in factory bot calls.'
458
+ Enabled: true
459
+ RSpec/FactoryBot/SyntaxMethods:
460
+ Description: 'Use shorthands from `FactoryBot::Syntax::Methods` in your specs.'
461
+ Enabled: true
462
+ RSpec/Rails/AvoidSetupHook:
463
+ Description: 'Checks that tests use RSpec `before` hook over Rails `setup` method.'
464
+ Enabled: true
465
+ RSpec/Rails/HaveHttpStatus:
466
+ Description: 'Checks that tests use `have_http_status` instead of equality matchers.'
467
+ Enabled: true
468
+ RSpec/Rails/InferredSpecType:
469
+ Description: 'Identifies redundant spec type.'
470
+ Enabled: true
471
+ Security/CompoundHash:
472
+ Description: 'When overwriting Object#hash to combine values, prefer delegating to Array#hash over writing a custom implementation.'
473
+ Enabled: true
474
+ Security/IoMethods:
475
+ Description: >-
476
+ Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`,
477
+ `IO.foreach`, and `IO.readlines`.
478
+ Enabled: true
479
+ Style/ArgumentsForwarding:
480
+ Description: 'Use arguments forwarding.'
481
+ Enabled: true
482
+ Style/ArrayIntersect:
483
+ Description: 'Use `array1.intersect?(array2)` instead of `(array1 & array2).any?`.'
484
+ Enabled: true
485
+ Style/CollectionCompact:
486
+ Description: 'Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject nils.'
487
+ Enabled: true
488
+ Style/ConcatArrayLiterals:
489
+ Description: 'Enforces the use of `Array#push(item)` instead of `Array#concat([item])` to avoid redundant array literals.'
490
+ Enabled: true
491
+ Style/ComparableClamp:
492
+ Description: 'Enforces the use of `Comparable#clamp` instead of comparison by minimum and maximum.'
493
+ Enabled: true
494
+ Style/DataInheritance:
495
+ Description: 'Checks for inheritance from Data.define.'
496
+ Enabled: true
497
+ Style/DirEmpty:
498
+ Description: >-
499
+ Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory is empty.
500
+ Enabled: true
501
+ Style/DocumentDynamicEvalDefinition:
502
+ Description: >-
503
+ When using `class_eval` (or other `eval`) with string interpolation,
504
+ add a comment block showing its appearance if interpolated.
505
+ Enabled: true
506
+ Style/EmptyHeredoc:
507
+ Description: 'Checks for using empty heredoc to reduce redundancy.'
508
+ Enabled: true
509
+ Style/EndlessMethod:
510
+ Description: 'Avoid the use of multi-lined endless method definitions.'
511
+ Enabled: true
512
+ Style/EnvHome:
513
+ Description: "Checks for consistent usage of `ENV['HOME']`."
514
+ Enabled: true
515
+ Style/ExactRegexpMatch:
516
+ Description: 'Checks for exact regexp match inside Regexp literals.'
517
+ Enabled: true
518
+ Style/FetchEnvVar:
519
+ Description: >-
520
+ Suggests `ENV.fetch` for the replacement of `ENV[]`.
521
+ Enabled: true
522
+ Style/FileEmpty:
523
+ Description: >-
524
+ Prefer to use `File.empty?('path/to/file')` when checking if a file is empty.
525
+ Enabled: true
526
+ Style/FileRead:
527
+ Description: 'Favor `File.(bin)read` convenience methods.'
528
+ Enabled: true
529
+ Style/FileWrite:
530
+ Description: 'Favor `File.(bin)write` convenience methods.'
531
+ Enabled: true
532
+ Style/HashConversion:
533
+ Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
534
+ Enabled: true
535
+ Style/HashExcept:
536
+ Description: >-
537
+ Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods
538
+ that can be replaced with `Hash#except` method.
539
+ Enabled: true
540
+ Style/IfWithBooleanLiteralBranches:
541
+ Description: 'Checks for redundant `if` with boolean literal branches.'
542
+ Enabled: true
543
+ Style/InPatternThen:
544
+ Description: 'Checks for `in;` uses in `case` expressions.'
545
+ Enabled: true
546
+ Style/MagicCommentFormat:
547
+ Description: 'Use a consistent style for magic comments.'
548
+ Enabled: true
549
+ Style/MapCompactWithConditionalBlock:
550
+ Description: 'Prefer `select` or `reject` over `map { ... }.compact`.'
551
+ Enabled: true
552
+ Style/MapToHash:
553
+ Description: 'Prefer `to_h` with a block over `map.to_h`.'
554
+ Enabled: true
555
+ Style/MapToSet:
556
+ Description: 'Prefer `to_set` with a block over `map.to_set`.'
557
+ Enabled: true
558
+ Style/MinMaxComparison:
559
+ Description: 'Enforces the use of `max` or `min` instead of comparison for greater or less.'
560
+ Enabled: true
561
+ Style/MultilineInPatternThen:
562
+ Description: 'Do not use `then` for multi-line `in` statement.'
563
+ Enabled: true
564
+ Style/NegatedIfElseCondition:
565
+ Description: >-
566
+ Checks for uses of `if-else` and ternary operators with a negated condition
567
+ which can be simplified by inverting condition and swapping branches.
568
+ Enabled: true
569
+ Style/NestedFileDirname:
570
+ Description: 'Checks for nested `File.dirname`.'
571
+ Enabled: true
572
+ Style/NilLambda:
573
+ Description: 'Prefer `-> {}` to `-> { nil }`.'
574
+ Enabled: true
575
+ Style/NumberedParameters:
576
+ Description: 'Restrict the usage of numbered parameters.'
577
+ Enabled: true
578
+ Style/NumberedParametersLimit:
579
+ Description: 'Avoid excessive numbered params in a single block.'
580
+ Enabled: true
581
+ Style/ObjectThen:
582
+ Description: 'Enforces the use of consistent method names `Object#yield_self` or `Object#then`.'
583
+ Enabled: true
584
+ Style/OpenStructUse:
585
+ Description: >-
586
+ Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged due to performance,
587
+ version compatibility, and potential security issues.
588
+ Enabled: true
589
+ Style/OperatorMethodCall:
590
+ Description: 'Checks for redundant dot before operator method call.'
591
+ Enabled: true
592
+ Style/QuotedSymbols:
593
+ Description: 'Use a consistent style for quoted symbols.'
594
+ Enabled: true
595
+ Style/RedundantArgument:
596
+ Description: 'Check for a redundant argument passed to certain methods.'
597
+ Enabled: true
598
+ Style/RedundantArrayConstructor:
599
+ Description: 'Checks for the instantiation of array using redundant `Array` constructor.'
600
+ Enabled: true
601
+ Style/RedundantConstantBase:
602
+ Description: Avoid redundant `::` prefix on constant.
603
+ Enabled: true
604
+ Style/RedundantCurrentDirectoryInPath:
605
+ Description: 'Checks for uses a redundant current directory in path.'
606
+ Enabled: true
607
+ Style/RedundantDoubleSplatHashBraces:
608
+ Description: 'Checks for redundant uses of double splat hash braces.'
609
+ Enabled: true
610
+ Style/RedundantEach:
611
+ Description: 'Checks for redundant `each`.'
612
+ Enabled: true
613
+ Style/RedundantFilterChain:
614
+ Description: >-
615
+ Identifies usages of `any?`, `empty?`, `none?` or `one?` predicate methods chained to
616
+ `select`/`filter`/`find_all` and change them to use predicate method instead.
617
+ Enabled: true
618
+ Style/RedundantHeredocDelimiterQuotes:
619
+ Description: 'Checks for redundant heredoc delimiter quotes.'
620
+ Enabled: true
621
+ Style/RedundantInitialize:
622
+ Description: 'Checks for redundant `initialize` methods.'
623
+ Enabled: true
624
+ Style/RedundantLineContinuation:
625
+ Description: 'Check for redundant line continuation.'
626
+ Enabled: true
627
+ Style/RedundantRegexpArgument:
628
+ Description: 'Identifies places where argument can be replaced from a deterministic regexp to a string.'
629
+ Enabled: true
630
+ Style/RedundantRegexpConstructor:
631
+ Description: 'Checks for the instantiation of regexp using redundant `Regexp.new` or `Regexp.compile`.'
632
+ Enabled: true
633
+ Style/RedundantSelfAssignmentBranch:
634
+ Description: 'Checks for places where conditional branch makes redundant self-assignment.'
635
+ Enabled: true
636
+ Style/RedundantStringEscape:
637
+ Description: 'Checks for redundant escapes in string literals.'
638
+ Enabled: true
639
+ Style/ReturnNilInPredicateMethodDefinition:
640
+ Description: 'Checks if uses of `return` or `return nil` in predicate method definition.'
641
+ Enabled: true
642
+ Style/SelectByRegexp:
643
+ Description: 'Prefer grep/grep_v to select/reject with a regexp match.'
644
+ Enabled: true
645
+ Style/SingleLineDoEndBlock:
646
+ Description: 'Checks for single-line `do`...`end` blocks.'
647
+ Enabled: true
648
+ Style/StringChars:
649
+ Description: 'Checks for uses of `String#split` with empty string or regexp literal argument.'
650
+ Enabled: true
651
+ Style/SuperWithArgsParentheses:
652
+ Description: 'Use parentheses for `super` with arguments.'
653
+ Enabled: true
654
+ Style/SwapValues:
655
+ Description: 'Enforces the use of shorthand-style swapping of 2 variables.'
656
+ Enabled: true
657
+ Style/YAMLFileRead:
658
+ Description: 'Checks for the use of `YAML.load`, `YAML.safe_load`, and `YAML.parse` with `File.read` argument.'
659
+ Enabled: true
660
+ Style/AccessorGrouping:
661
+ Description: Checks for grouping of accessors in `class` and `module` bodies.
662
+ Enabled: true
663
+ Style/ArrayCoercion:
664
+ Description: >-
665
+ Use Array() instead of explicit Array check or [*var], when dealing
666
+ with a variable you want to treat as an Array, but you're not certain it's an array.
667
+ Enabled: true
668
+ Style/BisectedAttrAccessor:
669
+ Description: >-
670
+ Checks for places where `attr_reader` and `attr_writer`
671
+ for the same method can be combined into single `attr_accessor`.
672
+ Enabled: true
673
+ Style/CaseLikeIf:
674
+ Description: This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.
675
+ Enabled: true
676
+ Style/ExplicitBlockArgument:
677
+ Description: >-
678
+ Consider using explicit block argument to avoid writing block literal
679
+ that just passes its arguments to another block.
680
+ Enabled: true
681
+ Style/ExponentialNotation:
682
+ Description: When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).
683
+ Enabled: true
684
+ Style/GlobalStdStream:
685
+ Description: Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.
686
+ Enabled: true
687
+ Style/HashAsLastArrayItem:
688
+ Description: >-
689
+ Checks for presence or absence of braces around hash literal as a last
690
+ array item depending on configuration.
691
+ Enabled: true
692
+ Style/HashEachMethods:
693
+ Description: Use Hash#each_key and Hash#each_value.
694
+ Enabled: true
695
+ Style/HashLikeCase:
696
+ Description: >-
697
+ Checks for places where `case-when` represents a simple 1:1
698
+ mapping and can be replaced with a hash lookup.
699
+ Enabled: true
700
+ Style/HashTransformKeys:
701
+ Description: Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.
702
+ Enabled: true
703
+ Style/HashTransformValues:
704
+ Description: Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.
705
+ Enabled: true
706
+ Style/OptionalBooleanParameter:
707
+ Description: Use keyword arguments when defining method with boolean argument.
708
+ Enabled: true
709
+ Style/RedundantAssignment:
710
+ Description: Checks for redundant assignment before returning.
711
+ Enabled: true
712
+ Style/RedundantFetchBlock:
713
+ Description: >-
714
+ Use `fetch(key, value)` instead of `fetch(key) { value }`
715
+ when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
716
+ Enabled: true
717
+ Style/RedundantFileExtensionInRequire:
718
+ Description: >-
719
+ Checks for the presence of superfluous `.rb` extension in
720
+ the filename provided to `require` and `require_relative`.
721
+ Enabled: true
722
+ Style/RedundantRegexpCharacterClass:
723
+ Description: Checks for unnecessary single-element Regexp character classes.
724
+ Enabled: true
725
+ Style/RedundantRegexpEscape:
726
+ Description: Checks for redundant escapes in Regexps.
727
+ Enabled: false
728
+ Style/SingleArgumentDig:
729
+ Description: Avoid using single argument dig method.
730
+ Enabled: true
731
+ Style/SlicingWithRange:
732
+ Description: Checks array slicing is done with endless ranges when suitable.
733
+ Enabled: true
734
+ Style/StringConcatenation:
735
+ Description: Checks for places where string concatenation can be replaced with string interpolation.
736
+ Enabled: true
737
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kpn-style
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-07 00:00:00.000000000 Z
11
+ date: 2024-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -59,6 +59,7 @@ files:
59
59
  - ruby-2.4.yml
60
60
  - ruby-2.5.yml
61
61
  - ruby-2.7.yml
62
+ - ruby-3.0.yml
62
63
  homepage: https://github.com/kpn-puppet/gem-kpn-style
63
64
  licenses:
64
65
  - Apache-2.0