cookstyle 7.31.1 → 7.31.3

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: d4fb241bb27dded65da8a9382cd172d32f5d4ed6304fd9cc13676295a0e3f528
4
- data.tar.gz: 87313da24732aae986f414527068758d5671cdede2c44ae565d4fbc51cbfc23d
3
+ metadata.gz: ef76b0aec4f125de72a07fdb9aac1e079b6ff6b873dff89d3e9ee1665a153843
4
+ data.tar.gz: 8d8332cf3c6c991fb7b483fc4de82e73cd47f4834304e105b624da6649c9845b
5
5
  SHA512:
6
- metadata.gz: 399f9449f81b57ad83aee7638d8e5481073061c16b567efac8945bf813ab5fee1a7f9effc37d6c795d8207c58ad528866ae1d9710192e40d1e94d65d3bfd45a1
7
- data.tar.gz: af6398f12b6cfe14701c11228ae1e7cd9419eafdd8abad04e850b97972650d1d64c2312ddeb2333a60733de6765cc76b508ffad52d219e3a942a8cc3965794ed
6
+ metadata.gz: e61f510b819dd0b81019a78e49ab6794b63890bc4e8940c39db6a2170fdbf28ca2b4d610eabd78ed0fe8d804eea66b746701f64927a82775c2fcab37cdd449dd
7
+ data.tar.gz: a0d25d86e1db04309786f376ea6ea3733d14be8e85651e7764879770ba3f28339bf99e7385c2ffc0144d03089886a6458e69c9bab8e9f29eff09731daf615a4a
data/config/upstream.yml CHANGED
@@ -430,13 +430,13 @@ Layout/ClassStructure:
430
430
  - prepend
431
431
  - extend
432
432
  ExpectedOrder:
433
- - module_inclusion
434
- - constants
435
- - public_class_methods
436
- - initializer
437
- - public_methods
438
- - protected_methods
439
- - private_methods
433
+ - module_inclusion
434
+ - constants
435
+ - public_class_methods
436
+ - initializer
437
+ - public_methods
438
+ - protected_methods
439
+ - private_methods
440
440
 
441
441
  Layout/ClosingHeredocIndentation:
442
442
  Description: 'Checks the indentation of here document closings.'
@@ -1900,7 +1900,7 @@ Lint/NestedPercentLiteral:
1900
1900
  VersionAdded: '0.52'
1901
1901
 
1902
1902
  Lint/NextWithoutAccumulator:
1903
- Description: >-
1903
+ Description: >-
1904
1904
  Do not omit the accumulator when calling `next`
1905
1905
  in a `reduce`/`inject` block.
1906
1906
  Enabled: true
@@ -3153,7 +3153,7 @@ Style/ClassMethodsDefinitions:
3153
3153
  StyleGuide: '#def-self-class-methods'
3154
3154
  Enabled: false
3155
3155
  VersionAdded: '0.89'
3156
- EnforcedStyle: def_self
3156
+ EnforcedStyle: def_self
3157
3157
  SupportedStyles:
3158
3158
  - def_self
3159
3159
  - self_class
@@ -3815,8 +3815,8 @@ Style/InverseMethods:
3815
3815
  :>: :<=
3816
3816
  # `ActiveSupport` defines some common inverse methods. They are listed below,
3817
3817
  # and not enabled by default.
3818
- #:present?: :blank?,
3819
- #:include?: :exclude?
3818
+ # :present?: :blank?,
3819
+ # :include?: :exclude?
3820
3820
  # `InverseBlocks` are methods that are inverted by inverting the return
3821
3821
  # of the block that is passed to the method
3822
3822
  InverseBlocks:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Cookstyle
3
- VERSION = "7.31.1" # rubocop: disable Style/StringLiterals
4
- RUBOCOP_VERSION = '1.25.0'
3
+ VERSION = "7.31.3" # rubocop: disable Style/StringLiterals
4
+ RUBOCOP_VERSION = '1.25.1'
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright:: 2020, Chef Software, Inc.
3
+ # Copyright:: 2020-2022, Chef Software, Inc.
4
4
  # Author:: Tim Smith (<tsmith@chef.io>)
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -48,6 +48,10 @@ module RuboCop
48
48
  # action :delete
49
49
  # end
50
50
  #
51
+ # file "/etc/cron.d/#{job_name}" do
52
+ # action :delete
53
+ # end
54
+ #
51
55
  # #### correct
52
56
  # cron_d 'backup' do
53
57
  # minute '1'
@@ -70,14 +74,19 @@ module RuboCop
70
74
  def_node_matcher :file_or_template?, <<-PATTERN
71
75
  (block
72
76
  (send nil? {:template :file :cookbook_file}
73
- (str $_))
77
+ $(...))
74
78
  ...
75
79
  )
76
80
  PATTERN
77
81
 
78
82
  def on_block(node)
79
83
  file_or_template?(node) do |file_name|
80
- return unless file_name.start_with?('/etc/cron.d/')
84
+ # weed out types we can't evaluate
85
+ return unless file_name.dstr_type? || file_name.str_type?
86
+
87
+ # weed out string values that aren't a cron.d file
88
+ return unless file_name.value.start_with?('/etc/cron.d/')
89
+
81
90
  add_offense(node, severity: :refactor)
82
91
  end
83
92
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookstyle
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.31.1
4
+ version: 7.31.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom May
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-26 00:00:00.000000000 Z
12
+ date: 2022-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubocop
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 1.25.0
20
+ version: 1.25.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 1.25.0
27
+ version: 1.25.1
28
28
  description:
29
29
  email:
30
30
  - thom@chef.io