chefstyle 2.1.2 → 2.2.2

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: 807f2b480f727abd6c611d64e6dfe42dde84a51561130f4d875a65cf36d2e873
4
- data.tar.gz: 47afd158a306d3fa87e22f4f7343ef0a3bad7aec5a3397c29e3c8cae7ef3f414
3
+ metadata.gz: 803d5b4d210e33252e9cf445357a577321cfb570fdd265e2d2c1201adb959fef
4
+ data.tar.gz: 310644c9afee2356062482b09755b514b103953946060eef2c1efda388984de1
5
5
  SHA512:
6
- metadata.gz: bb8d08252c5f5993270ae5ef62e47d36887b6703a2f9c3fac6d3b517bf78be8d037c3381da8fbd38a4afa5b4f83afae73fab300b5cdde17dec287232d6456af6
7
- data.tar.gz: 629902b61042ac71e9387eab6c39ee5cf4f4216f9caa61a8d77bd7321e76b19ff99b2869530f83257b6cb74cc56930a58faee664f24dc2f49caf0ecfcbbc0a59
6
+ metadata.gz: ca3e77ab4f46a9f13a2305961b665196539b684d719ceeb5765b5f6ee759ecea10548d36b6aaf4ca5741b35bf8015173bc7bffe3874b3acc93a6347bc6843400
7
+ data.tar.gz: 129546eeaadf9f7cb700dfd1b3396fc8b07b14a7843be0cdb4502198540e36e9cfff0ef03c3d5fe23369d26723e71f1bc5e5a6b5975852e52933b275f8c5a7ef
@@ -19,6 +19,8 @@ Gemspec/DuplicatedAssignment:
19
19
  Enabled: false
20
20
  Gemspec/OrderedDependencies:
21
21
  Enabled: false
22
+ Gemspec/RequireMFA:
23
+ Enabled: false
22
24
  Gemspec/RequiredRubyVersion:
23
25
  Enabled: false
24
26
  Gemspec/RubyVersionGlobalsUsage:
@@ -459,6 +461,8 @@ Lint/UselessElseWithoutRescue:
459
461
  Enabled: false
460
462
  Lint/UselessMethodDefinition:
461
463
  Enabled: false
464
+ Lint/UselessRuby2Keywords:
465
+ Enabled: false
462
466
  Lint/UselessSetterCall:
463
467
  Enabled: false
464
468
  Lint/UselessTimes:
@@ -487,6 +491,8 @@ Naming/AccessorMethodName:
487
491
  Enabled: false
488
492
  Naming/AsciiIdentifiers:
489
493
  Enabled: false
494
+ Naming/BlockForwarding:
495
+ Enabled: false
490
496
  Naming/BlockParameterName:
491
497
  Enabled: false
492
498
  Naming/ClassAndModuleCamelCase:
@@ -637,6 +643,10 @@ Style/ExplicitBlockArgument:
637
643
  Enabled: false
638
644
  Style/ExponentialNotation:
639
645
  Enabled: false
646
+ Style/FileRead:
647
+ Enabled: false
648
+ Style/FileWrite:
649
+ Enabled: false
640
650
  Style/FloatDivision:
641
651
  Enabled: false
642
652
  Style/For:
@@ -701,6 +711,8 @@ Style/LambdaCall:
701
711
  Enabled: false
702
712
  Style/LineEndConcatenation:
703
713
  Enabled: false
714
+ Style/MapToHash:
715
+ Enabled: false
704
716
  Style/MethodCallWithoutArgsParentheses:
705
717
  Enabled: false
706
718
  Style/MethodCallWithArgsParentheses:
@@ -709,6 +721,8 @@ Style/MultilineInPatternThen:
709
721
  Enabled: false
710
722
  Style/NumberedParameters:
711
723
  Enabled: false
724
+ Style/OpenStructUse:
725
+ Enabled: false
712
726
  Style/RedundantAssignment:
713
727
  Enabled: false
714
728
  Style/RedundantFetchBlock:
data/config/upstream.yml CHANGED
@@ -78,6 +78,8 @@ AllCops:
78
78
  # When specifying style guide URLs, any paths and/or fragments will be
79
79
  # evaluated relative to the base URL.
80
80
  StyleGuideBaseURL: https://rubystyle.guide
81
+ # Documentation URLs will be constructed using the base URL.
82
+ DocumentationBaseURL: https://docs.rubocop.org/rubocop
81
83
  # Extra details are not displayed in offense messages by default. Change
82
84
  # behavior by overriding ExtraDetails, or by giving the
83
85
  # `-E/--extra-details` option.
@@ -150,6 +152,7 @@ AllCops:
150
152
  rubocop-minitest: [minitest]
151
153
  rubocop-sequel: [sequel]
152
154
  rubocop-rake: [rake]
155
+ rubocop-graphql: [graphql]
153
156
 
154
157
  #################### Bundler ###############################
155
158
 
@@ -258,6 +261,15 @@ Gemspec/OrderedDependencies:
258
261
  Include:
259
262
  - '**/*.gemspec'
260
263
 
264
+ Gemspec/RequireMFA:
265
+ Description: 'Checks that the gemspec has metadata to require MFA from RubyGems.'
266
+ Enabled: pending
267
+ VersionAdded: '1.23'
268
+ Reference:
269
+ - https://guides.rubygems.org/mfa-requirement-opt-in/
270
+ Include:
271
+ - '**/*.gemspec'
272
+
261
273
  Gemspec/RequiredRubyVersion:
262
274
  Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
263
275
  Enabled: true
@@ -418,13 +430,13 @@ Layout/ClassStructure:
418
430
  - prepend
419
431
  - extend
420
432
  ExpectedOrder:
421
- - module_inclusion
422
- - constants
423
- - public_class_methods
424
- - initializer
425
- - public_methods
426
- - protected_methods
427
- - private_methods
433
+ - module_inclusion
434
+ - constants
435
+ - public_class_methods
436
+ - initializer
437
+ - public_methods
438
+ - protected_methods
439
+ - private_methods
428
440
 
429
441
  Layout/ClosingHeredocIndentation:
430
442
  Description: 'Checks the indentation of here document closings.'
@@ -439,7 +451,11 @@ Layout/ClosingParenthesisIndentation:
439
451
  Layout/CommentIndentation:
440
452
  Description: 'Indentation of comments.'
441
453
  Enabled: true
454
+ # When true, allows comments to have extra indentation if that aligns them
455
+ # with a comment on the preceding line.
456
+ AllowForAlignment: false
442
457
  VersionAdded: '0.49'
458
+ VersionChanged: '1.24'
443
459
 
444
460
  Layout/ConditionPosition:
445
461
  Description: >-
@@ -511,13 +527,13 @@ Layout/EmptyLineBetweenDefs:
511
527
  StyleGuide: '#empty-lines-between-methods'
512
528
  Enabled: true
513
529
  VersionAdded: '0.49'
514
- VersionChanged: '1.7'
530
+ VersionChanged: '1.23'
515
531
  EmptyLineBetweenMethodDefs: true
516
532
  EmptyLineBetweenClassDefs: true
517
533
  EmptyLineBetweenModuleDefs: true
518
- # If `true`, this parameter means that single line method definitions don't
519
- # need an empty line between them.
520
- AllowAdjacentOneLineDefs: false
534
+ # `AllowAdjacentOneLineDefs` means that single line method definitions don't
535
+ # need an empty line between them. `true` by default.
536
+ AllowAdjacentOneLineDefs: true
521
537
  # Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
522
538
  NumberOfEmptyLines: 1
523
539
 
@@ -1786,7 +1802,9 @@ Lint/ImplicitStringConcatenation:
1786
1802
  Lint/IncompatibleIoSelectWithFiberScheduler:
1787
1803
  Description: 'Checks for `IO.select` that is incompatible with Fiber Scheduler.'
1788
1804
  Enabled: pending
1805
+ SafeAutoCorrect: false
1789
1806
  VersionAdded: '1.21'
1807
+ VersionChanged: '1.24'
1790
1808
 
1791
1809
  Lint/IneffectiveAccessModifier:
1792
1810
  Description: >-
@@ -1882,7 +1900,7 @@ Lint/NestedPercentLiteral:
1882
1900
  VersionAdded: '0.52'
1883
1901
 
1884
1902
  Lint/NextWithoutAccumulator:
1885
- Description: >-
1903
+ Description: >-
1886
1904
  Do not omit the accumulator when calling `next`
1887
1905
  in a `reduce`/`inject` block.
1888
1906
  Enabled: true
@@ -2308,6 +2326,11 @@ Lint/UselessMethodDefinition:
2308
2326
  Safe: false
2309
2327
  AllowComments: true
2310
2328
 
2329
+ Lint/UselessRuby2Keywords:
2330
+ Description: 'Finds unnecessary uses of `ruby2_keywords`.'
2331
+ Enabled: pending
2332
+ VersionAdded: '1.23'
2333
+
2311
2334
  Lint/UselessSetterCall:
2312
2335
  Description: 'Checks for useless setter call to a local variable.'
2313
2336
  Enabled: true
@@ -2464,6 +2487,17 @@ Naming/BinaryOperatorParameterName:
2464
2487
  VersionAdded: '0.50'
2465
2488
  VersionChanged: '1.2'
2466
2489
 
2490
+ Naming/BlockForwarding:
2491
+ Description: 'Use anonymous block forwarding.'
2492
+ StyleGuide: '#block-forwarding'
2493
+ Enabled: pending
2494
+ VersionAdded: '1.24'
2495
+ EnforcedStyle: anonymous
2496
+ SupportedStyles:
2497
+ - anonymous
2498
+ - explicit
2499
+ BlockForwardingName: block
2500
+
2467
2501
  Naming/BlockParameterName:
2468
2502
  Description: >-
2469
2503
  Checks for block parameter names that contain capital letters,
@@ -2501,6 +2535,7 @@ Naming/FileName:
2501
2535
  StyleGuide: '#snake-case-files'
2502
2536
  Enabled: true
2503
2537
  VersionAdded: '0.50'
2538
+ VersionChanged: '1.23'
2504
2539
  # Camel case file names listed in `AllCops:Include` and all file names listed
2505
2540
  # in `AllCops:Exclude` are excluded by default. Add extra excludes here.
2506
2541
  Exclude: []
@@ -2513,6 +2548,13 @@ Naming/FileName:
2513
2548
  # whether each source file's class or module name matches the file name --
2514
2549
  # not whether the nested module hierarchy matches the subdirectory path.
2515
2550
  CheckDefinitionPathHierarchy: true
2551
+ # paths that are considered root directories, for example "lib" in most ruby projects
2552
+ # or "app/models" in rails projects
2553
+ CheckDefinitionPathHierarchyRoots:
2554
+ - lib
2555
+ - spec
2556
+ - test
2557
+ - src
2516
2558
  # If non-`nil`, expect all source file names to match the following regex.
2517
2559
  # Only the file name itself is matched, not the entire file path.
2518
2560
  # Use anchors as necessary if you want to match the entire name rather than
@@ -3111,7 +3153,7 @@ Style/ClassMethodsDefinitions:
3111
3153
  StyleGuide: '#def-self-class-methods'
3112
3154
  Enabled: false
3113
3155
  VersionAdded: '0.89'
3114
- EnforcedStyle: def_self
3156
+ EnforcedStyle: def_self
3115
3157
  SupportedStyles:
3116
3158
  - def_self
3117
3159
  - self_class
@@ -3469,6 +3511,18 @@ Style/ExponentialNotation:
3469
3511
  - engineering
3470
3512
  - integral
3471
3513
 
3514
+ Style/FileRead:
3515
+ Description: 'Favor `File.(bin)read` convenience methods.'
3516
+ StyleGuide: '#file-read'
3517
+ Enabled: pending
3518
+ VersionAdded: '1.24'
3519
+
3520
+ Style/FileWrite:
3521
+ Description: 'Favor `File.(bin)write` convenience methods.'
3522
+ StyleGuide: '#file-write'
3523
+ Enabled: pending
3524
+ VersionAdded: '1.24'
3525
+
3472
3526
  Style/FloatDivision:
3473
3527
  Description: 'For performing float division, coerce one side only.'
3474
3528
  StyleGuide: '#float-division'
@@ -3627,7 +3681,7 @@ Style/HashSyntax:
3627
3681
  StyleGuide: '#hash-literals'
3628
3682
  Enabled: true
3629
3683
  VersionAdded: '0.9'
3630
- VersionChanged: '0.43'
3684
+ VersionChanged: '1.24'
3631
3685
  EnforcedStyle: ruby19
3632
3686
  SupportedStyles:
3633
3687
  # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
@@ -3638,6 +3692,15 @@ Style/HashSyntax:
3638
3692
  - no_mixed_keys
3639
3693
  # enforces both ruby19 and no_mixed_keys styles
3640
3694
  - ruby19_no_mixed_keys
3695
+ # Force hashes that have a hash value omission
3696
+ EnforcedShorthandSyntax: always
3697
+ SupportedShorthandSyntax:
3698
+ # forces use of the 3.1 syntax (e.g. {foo:}) when the hash key and value are the same.
3699
+ - always
3700
+ # forces use of explicit hash literal value.
3701
+ - never
3702
+ # accepts both shorthand and explicit use of hash literal value.
3703
+ - either
3641
3704
  # Force hashes that have a symbol value to use hash rockets
3642
3705
  UseHashRocketsWithSymbolValues: false
3643
3706
  # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
@@ -3752,8 +3815,8 @@ Style/InverseMethods:
3752
3815
  :>: :<=
3753
3816
  # `ActiveSupport` defines some common inverse methods. They are listed below,
3754
3817
  # and not enabled by default.
3755
- #:present?: :blank?,
3756
- #:include?: :exclude?
3818
+ # :present?: :blank?,
3819
+ # :include?: :exclude?
3757
3820
  # `InverseBlocks` are methods that are inverted by inverting the return
3758
3821
  # of the block that is passed to the method
3759
3822
  InverseBlocks:
@@ -3814,6 +3877,12 @@ Style/LineEndConcatenation:
3814
3877
  VersionAdded: '0.18'
3815
3878
  VersionChanged: '0.64'
3816
3879
 
3880
+ Style/MapToHash:
3881
+ Description: 'Prefer `to_h` with a block over `map.to_h`.'
3882
+ Enabled: pending
3883
+ VersionAdded: '1.24'
3884
+ Safe: false
3885
+
3817
3886
  Style/MethodCallWithArgsParentheses:
3818
3887
  Description: 'Use parentheses for method calls with arguments.'
3819
3888
  StyleGuide: '#method-invocation-parens'
@@ -4182,6 +4251,8 @@ Style/NumericLiterals:
4182
4251
  VersionChanged: '0.48'
4183
4252
  MinDigits: 5
4184
4253
  Strict: false
4254
+ # You can specify allowed numbers. (e.g. port number 3000, 8080, and etc)
4255
+ AllowedNumbers: []
4185
4256
 
4186
4257
  Style/NumericPredicate:
4187
4258
  Description: >-
@@ -4216,6 +4287,16 @@ Style/OneLineConditional:
4216
4287
  VersionAdded: '0.9'
4217
4288
  VersionChanged: '0.90'
4218
4289
 
4290
+ Style/OpenStructUse:
4291
+ Description: >-
4292
+ Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged due to performance,
4293
+ version compatibility, and potential security issues.
4294
+ Reference:
4295
+ - https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats
4296
+
4297
+ Enabled: pending
4298
+ VersionAdded: '1.23'
4299
+
4219
4300
  Style/OptionHash:
4220
4301
  Description: "Don't use option hashes when you can use keyword arguments."
4221
4302
  Enabled: false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Chefstyle
3
- VERSION = "2.1.2"
4
- RUBOCOP_VERSION = "1.22.3"
3
+ VERSION = "2.2.2"
4
+ RUBOCOP_VERSION = "1.25.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chefstyle
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-27 00:00:00.000000000 Z
11
+ date: 2022-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.22.3
19
+ version: 1.25.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.22.3
26
+ version: 1.25.1
27
27
  description:
28
28
  email:
29
29
  - oss@chef.io