kpn-style 0.1.9 → 0.2.1

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